Skip to content

fix: nix packaging#147

Open
es-sai-fi wants to merge 1 commit into
JayanAXHF:mainfrom
es-sai-fi:nix-fix
Open

fix: nix packaging#147
es-sai-fi wants to merge 1 commit into
JayanAXHF:mainfrom
es-sai-fi:nix-fix

Conversation

@es-sai-fi
Copy link
Copy Markdown
Contributor

Solves #146.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 12, 2026

Greptile Summary

This PR fixes Nix packaging by splitting the legacy name attribute into separate pname and version fields (as required by modern buildRustPackage), removing allowBuiltinFetchGit (safe since Cargo.lock has no git-sourced dependencies), and injecting VERGEN_GIT_DESCRIBE / VERGEN_BUILD_DATE env vars so the binary reports a consistent version string at build time. It also adds /result to .gitignore to stop the Nix build symlink from being tracked.

  • package.nix: namepname + version, cargoLock simplified, env block added for VERGEN variables.
  • .gitignore: /result added to suppress the nix build output symlink from being committed.

Important Files Changed

Filename Overview
package.nix Fixes Nix packaging: splits name into pname+version, removes allowBuiltinFetchGit (safe — no git-sourced deps in Cargo.lock), and injects VERGEN env vars so the binary reports consistent version info at build time.
.gitignore Adds /result to ignore the Nix build symlink, addressing the issue raised in the previous review thread.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["nix build"] --> B["rustPlatform.buildRustPackage"]
    B --> C["Fetch src = ./."]
    C --> D["Resolve cargoLock.lockFile = ./Cargo.lock"]
    D --> E["Set env vars\nVERGEN_GIT_DESCRIBE=dev\nVERGEN_BUILD_DATE=unknown"]
    E --> F["cargo build --release"]
    F --> G["/nix/store/...-gitv-dev\n  bin/gitv"]
    G --> H["result symlink\n(ignored by .gitignore)"]
Loading

Reviews (5): Last reviewed commit: "fix: nix packaging" | Re-trigger Greptile

Comment thread package.nix
Comment thread package.nix
@es-sai-fi es-sai-fi force-pushed the nix-fix branch 2 times, most recently from 4bc8eb2 to 1db2141 Compare May 12, 2026 21:50
Comment thread result Outdated
@es-sai-fi
Copy link
Copy Markdown
Contributor Author

I removed cargoLock.allowBuiltinFetchGit from the package because it is not needed for gitv :P

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