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
This commit is contained in:
@@ -91,8 +91,8 @@ in
|
||||
# These defaults are set here rather than up there so that
|
||||
# changing them would not rebuild the manual
|
||||
version = mkDefault (cfg.release + cfg.versionSuffix);
|
||||
revision = mkIf (pathIsDirectory gitRepo) (mkDefault gitCommitId);
|
||||
versionSuffix = mkIf (pathIsDirectory gitRepo) (mkDefault (".git." + gitCommitId));
|
||||
revision = mkIf (pathExists gitRepo) (mkDefault gitCommitId);
|
||||
versionSuffix = mkIf (pathExists gitRepo) (mkDefault (".git." + gitCommitId));
|
||||
};
|
||||
|
||||
# Generate /etc/os-release. See
|
||||
|
||||
Reference in New Issue
Block a user