diff options
author | Thomas Mühlbacher <tmuehlbacher@posteo.net> | 2024-06-06 17:58:22 +0200 |
---|---|---|
committer | Thomas Mühlbacher <tmuehlbacher@posteo.net> | 2024-06-10 00:04:13 +0200 |
commit | 2a15fc044537a07fec61bf1dc003175309e5b067 (patch) | |
tree | 7761c791935546a19734c57cf6c6e231a5feaa34 | |
parent | 990437ad13f07b40eec1e3b1ff9ea8e7cf7ab689 (diff) |
build(nix): use actual commit rev in version
This way we get an actually unique version for every version that can be
traced back to the source.
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
-rw-r--r-- | flake.nix | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -66,11 +66,11 @@ craneLib = crane.mkLib pkgs; - libbcachefsCommit = substring 0 7 (builtins.readFile ./.bcachefs_revision); + rev = self.shortRev or self.dirtyShortRev or (substring 0 8 self.lastModifiedDate); makefileVersion = removePrefix "VERSION=" ( findFirst (line: hasPrefix "VERSION=" line) "VERSION=0.0.0" (split "\n" (readFile ./Makefile)) ); - version = "${makefileVersion}+git-${libbcachefsCommit}"; + version = "${makefileVersion}+${rev}"; commonArgs = { inherit version; |