about summary refs log tree commit diff
path: root/nixos/modules/misc/version.nix
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2016-07-28 18:10:17 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2016-08-01 11:10:02 +0200
commit2a05368ff3217175cd87105e778e2e70bc7eef1c (patch)
tree7357f947f5c7338a5876c22849ff49e37a3b1e7a /nixos/modules/misc/version.nix
parent0a1703ba279b186f3dac6dbed2d793c1172866f1 (diff)
downloadnixlib-2a05368ff3217175cd87105e778e2e70bc7eef1c.tar
nixlib-2a05368ff3217175cd87105e778e2e70bc7eef1c.tar.gz
nixlib-2a05368ff3217175cd87105e778e2e70bc7eef1c.tar.bz2
nixlib-2a05368ff3217175cd87105e778e2e70bc7eef1c.tar.lz
nixlib-2a05368ff3217175cd87105e778e2e70bc7eef1c.tar.xz
nixlib-2a05368ff3217175cd87105e778e2e70bc7eef1c.tar.zst
nixlib-2a05368ff3217175cd87105e778e2e70bc7eef1c.zip
Remove $NIXOS_LABEL and $NIXOS_VERSION
Relying on environment variables to override configuration options is
ugly, and there is no reason for them.
Diffstat (limited to 'nixos/modules/misc/version.nix')
-rw-r--r--nixos/modules/misc/version.nix23
1 files changed, 4 insertions, 19 deletions
diff --git a/nixos/modules/misc/version.nix b/nixos/modules/misc/version.nix
index 9a37f5950930..9158d82a73a6 100644
--- a/nixos/modules/misc/version.nix
+++ b/nixos/modules/misc/version.nix
@@ -35,23 +35,8 @@ in
     nixosLabel = mkOption {
       type = types.str;
       description = ''
-        NixOS version name to be used in the names of generated
-        outputs and boot labels.
-
-        If you ever wanted to influence the labels in your GRUB menu,
-        this is option is for you.
-
-        Can be set directly or with <envar>NIXOS_LABEL</envar>
-        environment variable for <command>nixos-rebuild</command>,
-        e.g.:
-
-        <screen>
-        #!/bin/sh
-        today=`date +%Y%m%d`
-        branch=`(cd nixpkgs ; git branch 2>/dev/null | sed -n '/^\* / { s|^\* ||; p; }')`
-        revision=`(cd nixpkgs ; git rev-parse HEAD)`
-        export NIXOS_LABEL="$today.$branch-''${revision:0:7}"
-        nixos-rebuild switch</screen>
+        Label to be used in the names of generated outputs and boot
+        labels.
       '';
     };
 
@@ -102,8 +87,8 @@ in
     system = {
       # These defaults are set here rather than up there so that
       # changing them would not rebuild the manual
-      nixosLabel   = mkDefault (maybeEnv "NIXOS_LABEL" cfg.nixosVersion);
-      nixosVersion = mkDefault (maybeEnv "NIXOS_VERSION" (cfg.nixosRelease + cfg.nixosVersionSuffix));
+      nixosLabel   = mkDefault cfg.nixosVersion;
+      nixosVersion = mkDefault (cfg.nixosRelease + cfg.nixosVersionSuffix);
       nixosRevision      = mkIf (pathIsDirectory gitRepo) (mkDefault            gitCommitId);
       nixosVersionSuffix = mkIf (pathIsDirectory gitRepo) (mkDefault (".git." + gitCommitId));