2015-04-01 03:58:19 +01:00
|
|
|
{ runCommand, git, nix }: src:
|
2015-03-28 19:57:54 +00:00
|
|
|
|
2015-04-01 03:58:19 +01:00
|
|
|
let hash = import (runCommand "head-hash.nix"
|
|
|
|
{ dummy = builtins.currentTime;
|
|
|
|
preferLocalBuild = true; }
|
|
|
|
''
|
|
|
|
cd ${toString src}
|
|
|
|
(${git}/bin/git show && ${git}/bin/git diff) > $out
|
|
|
|
hash=$(${nix}/bin/nix-hash $out)
|
|
|
|
echo "\"$hash\"" > $out
|
|
|
|
''); in
|
|
|
|
|
|
|
|
runCommand "local-git-export"
|
|
|
|
{ dummy = hash;
|
|
|
|
preferLocalBuild = true; }
|
|
|
|
''
|
2015-03-28 20:13:18 +00:00
|
|
|
cd ${toString src}
|
2015-03-28 19:57:54 +00:00
|
|
|
mkdir -p "$out"
|
|
|
|
for file in $(${git}/bin/git ls-files); do
|
|
|
|
mkdir -p "$out/$(dirname $file)"
|
2015-03-28 20:13:18 +00:00
|
|
|
cp -d $file "$out/$file" || true # don't fail when trying to copy a directory
|
2015-03-28 19:57:54 +00:00
|
|
|
done
|
|
|
|
''
|