about summary refs log tree commit diff
path: root/lib/default.nix
diff options
context:
space:
mode:
authorelseym <elseym@me.com>2020-01-10 21:24:31 +0100
committerelseym <elseym@me.com>2020-01-10 22:29:48 +0100
commitc9214c394b248e1f26e45dbe1be2bd82363af3a6 (patch)
treef28e88086f844a4d781fc9eb23bf7c078814b963 /lib/default.nix
parentb74c26a17f1856735577c29d92939721d542f0f5 (diff)
lib.commitIdFromGitRepo: support git-worktree
lib.commitIdFromGitRepo now resolves the refs from the
parent repository in case the supplied path is a file
containing the path to said repository. this adds support
for git-worktree and things alike. see gitrepository-layout(5).

this also:
- adds a new boolean function lib.pathIsRegularFile to
  check whether a path is a regular file
- patches lib.revisionWithDefault and
  the revision and versionSuffix attributes in
  config.system.nixos in order to support git-worktrees
Diffstat (limited to 'lib/default.nix')
-rw-r--r--lib/default.nix2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/default.nix b/lib/default.nix
index 9f7a088d792de..77dda17f3b4f1 100644
--- a/lib/default.nix
+++ b/lib/default.nix
@@ -100,7 +100,7 @@ let
     inherit (sources) pathType pathIsDirectory cleanSourceFilter
       cleanSource sourceByRegex sourceFilesBySuffices
       commitIdFromGitRepo cleanSourceWith pathHasContext
-      canCleanSource;
+      canCleanSource pathIsRegularFile;
     inherit (modules) evalModules unifyModuleSyntax
       applyIfFunction mergeModules
       mergeModules' mergeOptionDecls evalOptionValue mergeDefinitions