nix flake: include package version in derivation attributes

This allows the logic in
https://github.com/nix-community/home-manager/pull/6994 to be applied.
This commit is contained in:
Benjamin Tan 2025-05-10 22:57:54 +08:00 committed by Austin Seipp
parent 194ee8761c
commit 8020f1e1ad

View File

@ -31,6 +31,8 @@
];
};
packageVersion = (builtins.fromTOML (builtins.readFile ./Cargo.toml)).workspace.package.version;
filterSrc = src: regexes:
pkgs.lib.cleanSourceWith {
inherit src;
@ -90,7 +92,7 @@
packages = {
jujutsu = rustMinimalPlatform.buildRustPackage {
pname = "jujutsu";
version = "unstable-${self.shortRev or "dirty"}";
version = "${packageVersion}-unstable-${self.shortRev or "dirty"}";
cargoBuildFlags = ["--bin" "jj"]; # don't build and install the fake editors
useNextest = true;