Update Nix Flake
This skill covers Specture's repo-specific Nix packaging workflow.
Use it when:
flake.nixchangesgo.modorgo.sumchanges- Nix builds fail because
vendorHashis stale - release or packaging work touches the flake
Rules
- Keep
flake.nixand Go module metadata in sync. - Do not run
go mod vendor. This repository does not keep a vendored tree. - Prefer the repo's normal development workflow for everything else. This skill is only for the Nix-specific parts.
Updating vendorHash
When Go dependencies change, refresh vendorHash in flake.nix:
- Set
vendorHash = "";. - Run
nix build. - Read the error output and copy the
got:hash. - Replace the empty
vendorHashwith that hash. - Run
nix buildagain to verify the flake succeeds.
Expected error shape:
specified: sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
got: sha256-ZknVM8bMM0kLIbuV4Bv4XsbgtyhlKyP7p2AVOE1k0GA=
Use the got: value.
Validation Checklist
flake.nixstill evaluatesnix buildsucceedsvendorHashmatches the current module graph- no
vendor/directory was added
Notes
flake.nixcurrently builds the CLI withbuildGoModule.- The flake also defines the default package, app, and dev shell, so keep those intact unless the task requires changing them.