Skip to content

Commit

Permalink
Nix: add commit hash
Browse files Browse the repository at this point in the history
  • Loading branch information
fufexan committed May 5, 2024
1 parent 728243c commit 1e1fc79
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down
6 changes: 6 additions & 0 deletions nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
wayland-protocols,
wayland-scanner,
libXdmcp,
commit,
debug ? false,
version ? "git",
}:
Expand All @@ -32,6 +33,11 @@ stdenv.mkDerivation {

src = ../.;

prePatch = ''
substituteInPlace src/main.cpp \
--replace GIT_COMMIT_HASH '"${commit}"'
'';

cmakeBuildType =
if debug
then "Debug"
Expand Down

0 comments on commit 1e1fc79

Please sign in to comment.