about summary refs log tree commit diff
path: root/nixpkgs/lib/sources.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/lib/sources.nix')
-rw-r--r--nixpkgs/lib/sources.nix1
1 files changed, 1 insertions, 0 deletions
diff --git a/nixpkgs/lib/sources.nix b/nixpkgs/lib/sources.nix
index a5765c0fda5b..05519c3e392e 100644
--- a/nixpkgs/lib/sources.nix
+++ b/nixpkgs/lib/sources.nix
@@ -105,6 +105,7 @@ rec {
       in type == "directory" || lib.any (ext: lib.hasSuffix ext base) exts;
     in cleanSourceWith { inherit filter; src = path; };
 
+  pathIsGitRepo = path: (builtins.tryEval (commitIdFromGitRepo path)).success;
 
   # Get the commit id of a git repo
   # Example: commitIdFromGitRepo <nixpkgs/.git>