build(nix): add Nix flake for reproducible builds and dev shell#85
Open
nilp0inter wants to merge 1 commit into
Open
build(nix): add Nix flake for reproducible builds and dev shell#85nilp0inter wants to merge 1 commit into
nilp0inter wants to merge 1 commit into
Conversation
Add flake.nix exposing: - packages.onwatch: static pure-Go binary via buildGoModule (nixos-unstable) - devShell: go 1.26.4, gopls, gotools, gofumpt - apps.default for nix run Includes .envrc for direnv integration, updated .gitignore for result/, and Nix documentation in README.md and CLAUDE.md. Flake tracks nixos-unstable because go.mod requires Go >= 1.25.7 (nixos-25.05 only ships Go 1.24). VendorHash is pinned from go.sum.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add flake.nix exposing:
buildGoModule(tracks nixos-unstable)nix run .#onwatchIncludes:
.envrcfor direnv integration.gitignoreupdates forresult/Why nixos-unstable? The
go.modrequires Go >= 1.25.7, butnixos-25.05only ships Go 1.24 (andgo_1_25= 1.25.5). The flake tracksnixos-unstablewhich defaults to Go 1.26.x, satisfying the requirement while providing a reproducible, pinned toolchain.vendorHash: Pinned from
go.sum(sha256-zagPclPZItTTUaMh+8Ph7k5ESqc3vETPNkhMQ493MoY=). Ongo.sumchanges, update this hash by runningnix build .#onwatchand pasting thegot: sha256-...value from the mismatch error.Usage:
See the "Nix" section in README.md for details.