mirror of
https://github.com/LnL7/nix-darwin.git
synced 2024-12-14 11:57:34 +00:00
improve git revision detection
lib.pathIsDirectory doesn't follow symlinks causing the git revision detection to fail if NIX_PATH points to a symlink.
This commit is contained in:
parent
7045686b62
commit
2c6f80380f
1 changed files with 3 additions and 3 deletions
|
@ -8,7 +8,7 @@ let
|
|||
defaultStateVersion = options.system.stateVersion.default;
|
||||
|
||||
gitCommitId = lib.substring 0 7 (commitIdFromGitRepo gitRepo);
|
||||
gitRepo = "${toString pkgs.path}/.git";
|
||||
gitRepo = "${toString pkgs.path}/.git/";
|
||||
releaseFile = "${toString pkgs.path}/.version";
|
||||
revisionFile = "${toString pkgs.path}/.git-revision";
|
||||
suffixFile = "${toString pkgs.path}/.version-suffix";
|
||||
|
@ -71,8 +71,8 @@ in
|
|||
# These defaults are set here rather than up there so that
|
||||
# changing them would not rebuild the manual
|
||||
system.nixpkgsVersion = mkDefault (cfg.nixpkgsRelease + cfg.nixpkgsVersionSuffix);
|
||||
system.nixpkgsRevision = mkIf (pathIsDirectory gitRepo) (mkDefault gitCommitId);
|
||||
system.nixpkgsVersionSuffix = mkIf (pathIsDirectory gitRepo) (mkDefault (".git." + gitCommitId));
|
||||
system.nixpkgsRevision = mkIf (builtins.pathExists gitRepo) (mkDefault gitCommitId);
|
||||
system.nixpkgsVersionSuffix = mkIf (builtins.pathExists gitRepo) (mkDefault (".git." + gitCommitId));
|
||||
|
||||
assertions = [ { assertion = cfg.stateVersion <= defaultStateVersion; message = "system.stateVersion = ${toString cfg.stateVersion}; is not a valid value"; } ];
|
||||
|
||||
|
|
Loading…
Reference in a new issue