nixos/modules/misc/version.nix: check that .git is a directory

That's not the case for git submodules
Fixes #15928
This commit is contained in:
obadz
2016-06-03 13:38:41 +01:00
parent 30c94e10c3
commit 4c5fdf42ed
2 changed files with 8 additions and 2 deletions
+2 -2
View File
@@ -104,8 +104,8 @@ in
# changing them would not rebuild the manual
nixosLabel = mkDefault (maybeEnv "NIXOS_LABEL" cfg.nixosVersion);
nixosVersion = mkDefault (maybeEnv "NIXOS_VERSION" (cfg.nixosRelease + cfg.nixosVersionSuffix));
nixosRevision = mkIf (pathExists gitRepo) (mkDefault gitCommitId);
nixosVersionSuffix = mkIf (pathExists gitRepo) (mkDefault (".git." + gitCommitId));
nixosRevision = mkIf (pathIsDirectory gitRepo) (mkDefault gitCommitId);
nixosVersionSuffix = mkIf (pathIsDirectory gitRepo) (mkDefault (".git." + gitCommitId));
# Note: code names must only increase in alphabetical order.
nixosCodeName = "Flounder";