diff --git a/pkgs/development/ruby-modules/gem/default.nix b/pkgs/development/ruby-modules/gem/default.nix index b0abb2c54fc5..c881d4eb4744 100644 --- a/pkgs/development/ruby-modules/gem/default.nix +++ b/pkgs/development/ruby-modules/gem/default.nix @@ -63,7 +63,6 @@ let else if type == "git" then fetchgit { inherit (attrs.source) url rev sha256 fetchSubmodules; - leaveDotGit = true; } else if type == "url" then fetchurl attrs.source @@ -95,6 +94,7 @@ stdenv.mkDerivation ((builtins.removeAttrs attrs ["source"]) // { inherit src; + unpackPhase = attrs.unpackPhase or '' runHook preUnpack @@ -142,6 +142,12 @@ stdenv.mkDerivation ((builtins.removeAttrs attrs ["source"]) // { gempkg=$(echo "$output" | grep -oP 'File: \K(.*)') echo "gem package built: $gempkg" + elif [[ "$type" == "git" ]]; then + git init + # remove variations to improve the likelihood of a bit-reproducible output + rm -rf .git/logs/ .git/hooks/ .git/index .git/FETCH_HEAD .git/ORIG_HEAD .git/refs/remotes/origin/HEAD .git/config + # support `git ls-files` + git add . fi runHook postBuild