diff --git a/flake.nix b/flake.nix index 5abaa3b..c0984bf 100644 --- a/flake.nix +++ b/flake.nix @@ -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; }; diff --git a/nix/default.nix b/nix/default.nix index ab24856..32b0eee 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -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"