Skip to content

Commit aec84ec

Browse files
author
doyougnu
committed
Set SOURCE_DATE_EPOCH using git in nix
- Fixes haskellfoundation#58
1 parent 5a6ad46 commit aec84ec

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

hoh.nix

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ let
2222
sphinx-exec-haskell
2323
ghc
2424
cabal-install
25+
git
2526
];
2627
in
2728
pkgs.stdenv.mkDerivation {
@@ -30,9 +31,9 @@ pkgs.stdenv.mkDerivation {
3031
src = ./.;
3132
propagatedBuildInputs = pythonInputs ++ nonPythonInputs;
3233

33-
preBuild = ''
34-
unset SOURCE_DATE_EPOCH
35-
SOURCE_DATE_EPOCH=$(date +%s)
34+
# set SOURCE_DATE_EPOCH using git, fixes #58
35+
shellHook = ''
36+
SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)
3637
'';
3738

3839
buildPhase = ''

0 commit comments

Comments
 (0)