summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Mühlbacher <tmuehlbacher@posteo.net>2024-06-06 17:58:22 +0200
committerThomas Mühlbacher <tmuehlbacher@posteo.net>2024-06-10 00:04:13 +0200
commit2a15fc044537a07fec61bf1dc003175309e5b067 (patch)
tree7761c791935546a19734c57cf6c6e231a5feaa34
parent990437ad13f07b40eec1e3b1ff9ea8e7cf7ab689 (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.nix4
1 files changed, 2 insertions, 2 deletions
diff --git a/flake.nix b/flake.nix
index 5222d655..e4bc38ea 100644
--- a/flake.nix
+++ b/flake.nix
@@ -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;