chore(nix): bump cargo hash and version#162
Conversation
The nix flake wasn't building, because the cargo hash was out of date.
- Updates `cargoHash` to present state
- Updates `version` to present version
- Adds `cargoDepsName = finalAttrs.pname`
- Without setting the dependencies name to a static value, the hash
gets invalidated on every version bump of local crates. This creates
a large maintenance surface for the nix package, because the hash
needs to be updated with every single version change.
- By setting it to `pname`, the hash stays valid as long as external
dependencies don't change, i.e., only actual changes to `Cargo.lock`
will invalidate it.
Greptile SummaryThis PR fixes a broken Nix flake build by updating the
Confidence Score: 5/5Safe to merge — the changes are confined to the Nix build description and restore a previously broken build. The diff touches only nix/package.nix: a version string, a hash, and a single attribute that pins the vendored-deps derivation name. All three changes are consistent with the stated goal (fix the broken flake build and reduce future hash churn). The cargoDepsName = finalAttrs.pname pattern is well-understood in Nixpkgs and does not affect the content integrity guarantee of the fixed-output derivation. No application logic, APIs, or runtime behaviour are affected. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[nix build .#openlogi] --> B[rustPlatform.buildRustPackage]
B --> C{fetchCargoVendor}
C -->|"cargoDepsName = pname\n(stable: 'openlogi')"| D["FOD: openlogi-vendor\ncargoHash = sha256-HJuE…"]
D --> E[vendor directory\nwith Cargo deps]
E --> F[postPatch\nlink gpui-component-assets]
F --> G[cargo build\n--package=openlogi-gui]
G --> H[cargo bundle\nOpenLogi.app]
H --> I[$out/Applications/OpenLogi.app]
subgraph Before
X["cargoDepsName = 'openlogi-0.4.0'\n(invalidated on every version bump)"]
end
subgraph After
Y["cargoDepsName = 'openlogi'\n(stable across version bumps)"]
end
Reviews (1): Last reviewed commit: "chore(nix): bump cargo hash and version" | Re-trigger Greptile |
The nix flake wasn't building, because the cargo hash was out of date.
cargoHashto present stateversionto present versioncargoDepsName = finalAttrs.pnamepname, the hash stays valid as long as external dependencies stay consistent, i.e., only actual changes toCargo.lockwill invalidate it.nixpkgs, it would make sense to retain the default forcargoDepsNameand rely on the autobump behaviour; for a local flake, which will always reflect the state of the current branch, minimising hash churn seems like the better option