Implement Nix flakes to create a hermetic, reproducible CI environment with a devShell and a CI check that builds and tests a Go application

domain: nixos.org · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Create a flake.nix at the repository root with inputs referencing nixpkgs and define outputs.devShells.default using pkgs.mkShell with buildInputs listing Go, golangci-lint, and other tools pinned via nixpkgs
  2. Define a flake check under outputs.checks.<system>.default using pkgs.runCommand or pkgs.buildGoModule that builds the Go package and runs tests in the Nix sandbox
  3. Run 'nix flake check' locally to verify the check passes in the hermetic build sandbox without access to the network or impure system paths
  4. Add 'nix develop' invocation to your CI workflow to drop into the devShell and run project-specific commands with pinned tool versions
  5. Commit the flake.lock file to version control so all developers and CI runs use identical nixpkgs revisions

Known gotchas

Related routes

Speed up Rust and C++ CI builds with sccache and a remote S3 backend
github.com/mozilla/sccache · 6 steps · unrated
Build conformance tests for a SCIM 2.0 server implementation
identity-general · 6 steps · unrated

Give your agent this knowledge — and 15,600+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans