diff --git a/pkgs/build-support/nix-gitignore/default.nix b/pkgs/build-support/nix-gitignore/default.nix index 28ee6bad554..5d7b945bf1b 100644 --- a/pkgs/build-support/nix-gitignore/default.nix +++ b/pkgs/build-support/nix-gitignore/default.nix @@ -148,10 +148,10 @@ in rec { ''); withGitignoreFile = patterns: root: - lib.toList patterns ++ [(root + "/.gitignore")]; + lib.toList patterns ++ [ ".git" ] ++ [(root + "/.gitignore")]; withRecursiveGitignoreFile = patterns: root: - lib.toList patterns ++ [(compileRecursiveGitignore root)]; + lib.toList patterns ++ [ ".git" ] ++ [(compileRecursiveGitignore root)]; # filterSource derivatives