Skip to content

nix: split flake into package.nix + lean dev shell#335

Merged
cpcloud merged 2 commits into
kenn-io:mainfrom
cpcloud:nix-flake-cleanup
May 21, 2026
Merged

nix: split flake into package.nix + lean dev shell#335
cpcloud merged 2 commits into
kenn-io:mainfrom
cpcloud:nix-flake-cleanup

Conversation

@cpcloud
Copy link
Copy Markdown
Contributor

@cpcloud cpcloud commented May 21, 2026

Summary

  • flake.nix now wires inputs and exposes packages.default, apps.default, and devShells.default via flake-utils
  • Application build moved to nix/package.nix
  • nix build .# and nix run .# produce a working msgvault binary; the prior block was missing sqlite in buildInputs, so sqlite-vec-go-bindings couldn't find sqlite3.h
  • sqlite_vec build tag added to match the Makefile
  • Source filtered through gitignore.nix so .direnv, .claude, etc. stay out of the build closure
  • devShell keeps Go 1.26.3 / golangci-lint / gcc / prek and adds gopls, gotools, delve, sqlite-interactive
  • scripts/update-nix-flake.sh now seds nix/package.nix instead of flake.nix

Usage

nix build .#        # build msgvault
nix run .# -- ...   # run msgvault directly
nix develop         # enter the dev shell

cpcloud added 2 commits May 21, 2026 14:55
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.
@cpcloud cpcloud merged commit d4d413c into kenn-io:main May 21, 2026
3 checks passed
@cpcloud cpcloud deleted the nix-flake-cleanup branch May 21, 2026 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant