summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorMaximilian Bosch <maximilian@mbosch.me>2018-04-24 20:33:35 +0200
committerMaximilian Bosch <maximilian@mbosch.me>2018-04-28 14:23:13 +0200
commit39909289f452fcd60127cbd2372f22ac35f25d08 (patch)
treec0f9e9020ae6159bda356424f316e23f9b319e64 /nixos
parentf66cdc71a3300581501fd953f8e359b7ff824933 (diff)
downloadnixpkgs-39909289f452fcd60127cbd2372f22ac35f25d08.tar
nixpkgs-39909289f452fcd60127cbd2372f22ac35f25d08.tar.gz
nixpkgs-39909289f452fcd60127cbd2372f22ac35f25d08.tar.bz2
nixpkgs-39909289f452fcd60127cbd2372f22ac35f25d08.tar.lz
nixpkgs-39909289f452fcd60127cbd2372f22ac35f25d08.tar.xz
nixpkgs-39909289f452fcd60127cbd2372f22ac35f25d08.tar.zst
nixpkgs-39909289f452fcd60127cbd2372f22ac35f25d08.zip
lib: deduplicate version/suffix references
The logic regarding the generated `.version-suffix` file is already
defined in `lib/trivial.nix` and shouldn't be duplicated in
`nixos/version`.
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/misc/version.nix6
1 files changed, 2 insertions, 4 deletions
diff --git a/nixos/modules/misc/version.nix b/nixos/modules/misc/version.nix
index b8f0a223c91..d9d60b72509 100644
--- a/nixos/modules/misc/version.nix
+++ b/nixos/modules/misc/version.nix
@@ -5,8 +5,6 @@ with lib;
 let
   cfg = config.system.nixos;
 
-  releaseFile  = "${toString pkgs.path}/.version";
-  suffixFile   = "${toString pkgs.path}/.version-suffix";
   revisionFile = "${toString pkgs.path}/.git-revision";
   gitRepo      = "${toString pkgs.path}/.git";
   gitCommitId  = lib.substring 0 7 (commitIdFromGitRepo gitRepo);
@@ -25,14 +23,14 @@ in
     nixos.release = mkOption {
       readOnly = true;
       type = types.str;
-      default = fileContents releaseFile;
+      default = trivial.version;
       description = "The NixOS release (e.g. <literal>16.03</literal>).";
     };
 
     nixos.versionSuffix = mkOption {
       internal = true;
       type = types.str;
-      default = if pathExists suffixFile then fileContents suffixFile else "pre-git";
+      default = trivial.suffix;
       description = "The NixOS version suffix (e.g. <literal>1160.f2d4ee1</literal>).";
     };