---
pkgs/build-support/fetchgit/builder.sh | 6 ++++--
pkgs/build-support/fetchgit/default.nix | 4 ++--
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/pkgs/build-support/fetchgit/builder.sh b/pkgs/build-support/fetchgit/builder.sh
index 08a1cc5..ba06aed 100644
--- a/pkgs/build-support/fetchgit/builder.sh
+++ b/pkgs/build-support/fetchgit/builder.sh
@@ -7,7 +7,9 @@ if test -n "$rev"; then
cd $out
git checkout $rev
fi
-find $out -name .git\* | xargs rm -rf
-stopNest
+if test -z "$leaveDotGit"; then
+ find $out -name .git\* | xargs rm -rf
+fi
+stopNest
diff --git a/pkgs/build-support/fetchgit/default.nix b/pkgs/build-support/fetchgit/default.nix
index 8fd86cd..a0ad57e 100644
--- a/pkgs/build-support/fetchgit/default.nix
+++ b/pkgs/build-support/fetchgit/default.nix
@@ -1,5 +1,5 @@
{stdenv, git}:
-{url, rev ? "HEAD", md5 ? "", sha256 ? ""}:
+{url, rev ? "HEAD", md5 ? "", sha256 ? "", leaveDotGit ? false }:
/* NOTE:
fetchgit has one problem: git fetch only works for refs.
@@ -32,7 +32,7 @@ stdenv.mkDerivation {
outputHashMode = "recursive";
outputHash = if sha256 == "" then md5 else sha256;
- inherit url rev;
+ inherit url rev leaveDotGit;
impureEnvVars = [
# We borrow these environment variables from the caller to allow
_______________________________________________
nix-dev mailing list
[email protected]
https://mail.cs.uu.nl/mailman/listinfo/nix-dev