Nix: add commit hash

This commit is contained in:
Mihai Fufezan 2024-05-05 15:04:53 +03:00
parent 728243cef0
commit 1e1fc79d84
Signed by: fufexan
SSH key fingerprint: SHA256:SdnKmEpJrDu1+2UO1QpB/Eg4HKcdDi6n+xSRqFNJVpg
2 changed files with 7 additions and 0 deletions

View file

@ -35,6 +35,7 @@
hyprpaper = final.callPackage ./nix/default.nix {
stdenv = final.gcc13Stdenv;
version = "0.pre" + "+date=" + (mkDate (self.lastModifiedDate or "19700101")) + "_" + (self.shortRev or "dirty");
commit = self.rev or "";
inherit (final.xorg) libXdmcp;
inherit (inputs.hyprlang.packages.${final.system}) hyprlang;
};

View file

@ -23,6 +23,7 @@
wayland-protocols,
wayland-scanner,
libXdmcp,
commit,
debug ? false,
version ? "git",
}:
@ -32,6 +33,11 @@ stdenv.mkDerivation {
src = ../.;
prePatch = ''
substituteInPlace src/main.cpp \
--replace GIT_COMMIT_HASH '"${commit}"'
'';
cmakeBuildType =
if debug
then "Debug"