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

View File

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