nix: split flake into package.nix + lean dev shell#335
Merged
Conversation
Restructures the flake so `nix build .#` and `nix run .#` produce a working msgvault binary, and the devShell stays focused on dev tools rather than quietly pulling the application's build closure on every `cd`. Changes: - Move the buildGoModule call into `nix/package.nix`; the top-level flake wires inputs and exposes per-system outputs via flake-utils - Add `sqlite` to `buildInputs` so `sqlite-vec-go-bindings` finds `sqlite3.h` (this is the cause `nix build` failed before, even though the package block existed) - Set both `fts5` and `sqlite_vec` build tags, matching the Makefile - Filter source through `gitignore.nix` so the build closure doesn't include `.direnv`, `.claude`, etc. - Expose `apps.default` so `nix run .#` resolves to the msgvault binary - Add `gopls`, `gotools`, `delve`, and `sqlite-interactive` to the devShell alongside the existing go/golangci-lint/gcc/prek Update `scripts/update-nix-flake.sh` to sed `nix/package.nix` instead of `flake.nix`, since `vendorHash` and `version` now live there.
Routine flake.lock refresh. Go 1.26.2 in this nixpkgs revision; the goPinned override to 1.26.3 still applies.
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.
Summary
flake.nixnow wires inputs and exposespackages.default,apps.default, anddevShells.defaultvia flake-utilsnix/package.nixnix build .#andnix run .#produce a working msgvault binary; the prior block was missingsqliteinbuildInputs, sosqlite-vec-go-bindingscouldn't findsqlite3.hsqlite_vecbuild tag added to match the Makefilegitignore.nixso.direnv,.claude, etc. stay out of the build closuredevShellkeeps Go 1.26.3 / golangci-lint / gcc / prek and addsgopls,gotools,delve,sqlite-interactivescripts/update-nix-flake.shnow sedsnix/package.nixinstead offlake.nixUsage