- 100+ Go versions — from 1.17 to latest, including release candidates, updated within 4 hours of a new release on go.dev.
- No stale
vendorHash — dependencies are pinned per-module with NAR hashes. Change a dep, re-run govendor. No hash archaeology.
- Every platform, one pass — dependency resolution covers every
GOOS/GOARCH and build tag automatically. Cross-compile anywhere without flags or manifest regeneration.
- Workspace support — build multi-module
go.work monorepos reproducibly. Neither buildGoModule nor gomod2nix can do this.
- Go tools pinned to your toolchain — govulncheck, gopls, golangci-lint, and more, updated within 6 hours of release and version-locked to your selected Go version with a clear error if incompatible.
- Private modules — standard Go authentication via
.netrc, no custom infrastructure required.
Getting Started
Find a Go version
List the Go versions go-overlay provides, without cloning the repository or compiling anything:
nix run github:purpleclay/go-overlay#goversions
VERSION RELEASED STATUS PACKAGE
1.27.1 2026-09-01 latest (stable) go_1_27_1
1.26.8 2026-09-01 supported go_1_26_8
1.25.13 2026-08-13 eol go_1_25_13
...
It lists Go tools too. Pass --tools for every tool and its latest version, or name a tool to list its versions, optionally only those that work with your Go:
nix run github:purpleclay/go-overlay#goversions -- --tools
nix run github:purpleclay/go-overlay#goversions -- gopls --go 1.26
Run it with -- --help to see how to filter the list.
Try a Go version without installing anything
Run the latest release, including release candidates:
nix run github:purpleclay/go-overlay -- version
# go version go1.27.1 linux/amd64
Or run a specific version from the PACKAGE column:
nix run github:purpleclay/go-overlay#go_1_24_13 -- version
# go version go1.24.13 linux/amd64
Create a new project
The template bootstraps a new project with a dev shell, builder, and drift detection pre-configured:
nix flake new -t github:purpleclay/go-overlay my-app
Create a workspace project
The workspace template bootstraps a minimal multi-module monorepo with a dev shell, builder, and drift detection pre-configured:
nix flake new -t github:purpleclay/go-overlay#workspace my-monorepo
Create a container image project
The image template bootstraps a Go application pre-configured to produce a buildLayeredImage container image alongside the binary:
nix flake new -t github:purpleclay/go-overlay#image my-app
Onboard an existing project
1. Add the flake input
Add go-overlay to your flake.nix inputs and apply the overlay:
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
go-overlay.url = "github:purpleclay/go-overlay";
};
outputs = { nixpkgs, flake-utils, go-overlay, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ go-overlay.overlays.default ];
};
in { ... }
);
}
[!TIP]
Not using flakes? default.nix is an overlay. See the traditional Nix installation guide for more.
2. Add govendor to your dev shell
govendor generates and maintains the dependency manifest used during builds:
devShells.default = pkgs.mkShell {
buildInputs = [
go-overlay.packages.${system}.govendor
];
};
3. Generate and commit the manifest
govendor
This creates a govendor.toml with NAR hashes for all dependencies. Commit it to your repository.