mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-21 05:00:16 +00:00
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.
This commit is contained in:
parent
a5f883e535
commit
f0f040c3f7
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue