about summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorArtturin <Artturin@artturin.com>2022-11-18 17:17:51 +0200
committerArtturin <Artturin@artturin.com>2022-11-18 17:17:51 +0200
commit962929884a5b841521faf914497f847d5f07955f (patch)
tree89f107812cce01e18c0db4a6d0dfc1ec23247913 /lib
parentdba0c71b6d15e323d4b8235d9474322520938dc8 (diff)
lib/sources: make commitIdFromGitRepoOrError internal and use # for comments
so that it doesn't make the manual build fail

> Apparently this is related to the combination of this new function not getting exported from the file, while still getting documented.
Diffstat (limited to 'lib')
-rw-r--r--lib/sources.nix15
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/sources.nix b/lib/sources.nix
index 9db3d23295421..3ad7dc6335549 100644
--- a/lib/sources.nix
+++ b/lib/sources.nix
@@ -166,7 +166,7 @@ let
       in type == "directory" || lib.any (ext: lib.hasSuffix ext base) exts;
     in cleanSourceWith { inherit filter src; };
 
-  pathIsGitRepo = path: (commitIdFromGitRepoOrError path)?value;
+  pathIsGitRepo = path: (_commitIdFromGitRepoOrError path)?value;
 
   /*
     Get the commit id of a git repo.
@@ -174,17 +174,16 @@ let
     Example: commitIdFromGitRepo <nixpkgs/.git>
   */
   commitIdFromGitRepo = path:
-    let commitIdOrError = commitIdFromGitRepoOrError path;
+    let commitIdOrError = _commitIdFromGitRepoOrError path;
     in commitIdOrError.value or (throw commitIdOrError.error);
 
-  /*
-    Get the commit id of a git repo.
+  # Get the commit id of a git repo.
 
-    Returns `{ value = commitHash }` or `{ error = "... message ..." }`.
+  # Returns `{ value = commitHash }` or `{ error = "... message ..." }`.
 
-    Example: commitIdFromGitRepo <nixpkgs/.git>
-  */
-  commitIdFromGitRepoOrError =
+  # Example: commitIdFromGitRepo <nixpkgs/.git>
+  # not exported, used for commitIdFromGitRepo
+  _commitIdFromGitRepoOrError =
     let readCommitFromFile = file: path:
         let fileName       = path + "/${file}";
             packedRefsName = path + "/packed-refs";