Skip to content

Commit 7a7078d

Browse files
committed
nix: include commit hash in package version
`shortRev` doesn't exist if uncommitted changes exist, which is why the "dirty" fallback exists. Otherwise this makes it easier to diagnose which version is currently installed for those installing tms via the flake, and makes it easier to report issues/regressions if a specific commit can be identified. `tms --version` output is unaffected.
1 parent 7f01661 commit 7a7078d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

flake.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,11 @@
4444
(import rust-overlay)
4545
];
4646
};
47+
packageVersion = (fromTOML (builtins.readFile ./Cargo.toml)).package.version;
4748
rustToolchain = pkgs.pkgsBuildHost.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
4849
craneLib = (crane.mkLib pkgs).overrideToolchain rustToolchain;
4950
commonArgs = with pkgs; {
51+
version = "${packageVersion}-${self.shortRev or "dirty"}";
5052
src = craneLib.cleanCargoSource ./.;
5153
strictDeps = true;
5254

0 commit comments

Comments
 (0)