summary refs log tree commit diff
path: root/nixos/modules/misc/version.nix
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-02-15 20:15:05 +0100
committerEelco Dolstra <edolstra@gmail.com>2020-02-15 20:16:14 +0100
commitf0f040c3f7f07fa4dc28b32d44e1db78fa3a0cc1 (patch)
treee59e7d99ac101eab753acd9257037a4c6cce5de8 /nixos/modules/misc/version.nix
parenta5f883e5359ca97fb946dade25418d5732e3cdf7 (diff)
downloadnixpkgs-f0f040c3f7f07fa4dc28b32d44e1db78fa3a0cc1.tar
nixpkgs-f0f040c3f7f07fa4dc28b32d44e1db78fa3a0cc1.tar.gz
nixpkgs-f0f040c3f7f07fa4dc28b32d44e1db78fa3a0cc1.tar.bz2
nixpkgs-f0f040c3f7f07fa4dc28b32d44e1db78fa3a0cc1.tar.lz
nixpkgs-f0f040c3f7f07fa4dc28b32d44e1db78fa3a0cc1.tar.xz
nixpkgs-f0f040c3f7f07fa4dc28b32d44e1db78fa3a0cc1.tar.zst
nixpkgs-f0f040c3f7f07fa4dc28b32d44e1db78fa3a0cc1.zip
nixos/modules/misc/version.nix: Don't parse .git
This leads to inconsistent results between local builds and
Hydra. Also Nix is not a general purpose language, we shouldn't be
parsing .git from inside Nix code.
Diffstat (limited to 'nixos/modules/misc/version.nix')
-rw-r--r--nixos/modules/misc/version.nix6
1 files changed, 0 insertions, 6 deletions
diff --git a/nixos/modules/misc/version.nix b/nixos/modules/misc/version.nix
index c394ff592f4..9557def622d 100644
--- a/nixos/modules/misc/version.nix
+++ b/nixos/modules/misc/version.nix
@@ -4,10 +4,6 @@ with lib;
 
 let
   cfg = config.system.nixos;
-
-  gitRepo      = "${toString pkgs.path}/.git";
-  gitRepoValid = lib.pathIsGitRepo gitRepo;
-  gitCommitId  = lib.substring 0 7 (commitIdFromGitRepo gitRepo);
 in
 
 {
@@ -98,8 +94,6 @@ 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 gitRepoValid (mkDefault            gitCommitId);
-      versionSuffix = mkIf gitRepoValid (mkDefault (".git." + gitCommitId));
     };
 
     # Generate /etc/os-release.  See