2015-04-01 04:58:19 +02:00
|
|
|
{ runCommand, git, nix }: src:
|
2015-03-28 20:57:54 +01:00
|
|
|
|
2015-04-01 04:58:19 +02: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 21:13:18 +01:00
|
|
|
cd ${toString src}
|
2015-03-28 20:57:54 +01:00
|
|
|
mkdir -p "$out"
|
|
|
|
for file in $(${git}/bin/git ls-files); do
|
|
|
|
mkdir -p "$out/$(dirname $file)"
|
2015-03-28 21:13:18 +01:00
|
|
|
cp -d $file "$out/$file" || true # don't fail when trying to copy a directory
|
2015-03-28 20:57:54 +01:00
|
|
|
done
|
|
|
|
''
|