diff options
author | Tuomas Tynkkynen <tuomas@tuxera.com> | 2018-07-25 23:22:54 +0300 |
---|---|---|
committer | Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi> | 2018-07-28 00:12:55 +0300 |
commit | 96190535e526bc1f7b8975d9f6f2f6493060203f (patch) | |
tree | 035be138fdceaef8294f7136a88b496ddf101050 /nixos/modules | |
parent | 28e11a0b6ba740aedcc8be27ff8ef334d187bd37 (diff) | |
download | nixlib-96190535e526bc1f7b8975d9f6f2f6493060203f.tar nixlib-96190535e526bc1f7b8975d9f6f2f6493060203f.tar.gz nixlib-96190535e526bc1f7b8975d9f6f2f6493060203f.tar.bz2 nixlib-96190535e526bc1f7b8975d9f6f2f6493060203f.tar.lz nixlib-96190535e526bc1f7b8975d9f6f2f6493060203f.tar.xz nixlib-96190535e526bc1f7b8975d9f6f2f6493060203f.tar.zst nixlib-96190535e526bc1f7b8975d9f6f2f6493060203f.zip |
Revert "nixos: rename system.{stateVersion,defaultChannel} -> system.nixos.\1"
This reverts commit 095fe5b43def40279a243e663c662b02caac5318. Pointless renames considered harmful. All they do is force people to spend extra work updating their configs for no benefit, and hindering the ability to switch between unstable and stable versions of NixOS. Like, what was the value of having the "nixos." there? I mean, by definition anything in a NixOS module has something to do with NixOS...
Diffstat (limited to 'nixos/modules')
-rw-r--r-- | nixos/modules/installer/cd-dvd/installation-cd-base.nix | 2 | ||||
-rw-r--r-- | nixos/modules/installer/tools/nixos-generate-config.pl | 2 | ||||
-rw-r--r-- | nixos/modules/installer/virtualbox-demo.nix | 2 | ||||
-rw-r--r-- | nixos/modules/misc/version.nix | 16 | ||||
-rw-r--r-- | nixos/modules/programs/shell.nix | 2 | ||||
-rw-r--r-- | nixos/modules/rename.nix | 2 | ||||
-rw-r--r-- | nixos/modules/services/databases/mysql.nix | 2 | ||||
-rw-r--r-- | nixos/modules/services/databases/postgresql.nix | 10 | ||||
-rw-r--r-- | nixos/modules/services/misc/matrix-synapse.nix | 2 | ||||
-rw-r--r-- | nixos/modules/services/network-filesystems/ipfs.nix | 2 | ||||
-rw-r--r-- | nixos/modules/services/networking/radicale.nix | 4 | ||||
-rw-r--r-- | nixos/modules/services/web-servers/caddy.nix | 2 | ||||
-rw-r--r-- | nixos/modules/testing/test-instrumentation.nix | 2 | ||||
-rw-r--r-- | nixos/modules/virtualisation/amazon-options.nix | 2 | ||||
-rw-r--r-- | nixos/modules/virtualisation/containers.nix | 2 |
15 files changed, 26 insertions, 28 deletions
diff --git a/nixos/modules/installer/cd-dvd/installation-cd-base.nix b/nixos/modules/installer/cd-dvd/installation-cd-base.nix index 298b8d88bb59..36024ce9f45e 100644 --- a/nixos/modules/installer/cd-dvd/installation-cd-base.nix +++ b/nixos/modules/installer/cd-dvd/installation-cd-base.nix @@ -32,5 +32,5 @@ with lib; # Allow the user to log in as root without a password. users.users.root.initialHashedPassword = ""; - system.nixos.stateVersion = mkDefault "18.03"; + system.stateVersion = mkDefault "18.03"; } diff --git a/nixos/modules/installer/tools/nixos-generate-config.pl b/nixos/modules/installer/tools/nixos-generate-config.pl index 165566912401..cbe145d5a330 100644 --- a/nixos/modules/installer/tools/nixos-generate-config.pl +++ b/nixos/modules/installer/tools/nixos-generate-config.pl @@ -628,7 +628,7 @@ $bootLoaderConfig # compatible, in order to avoid breaking some software such as database # servers. You should change this only after NixOS release notes say you # should. - system.nixos.stateVersion = "${\(qw(@release@))}"; # Did you read the comment? + system.stateVersion = "${\(qw(@release@))}"; # Did you read the comment? } EOF diff --git a/nixos/modules/installer/virtualbox-demo.nix b/nixos/modules/installer/virtualbox-demo.nix index f823c0d83bb6..8ca3592f3800 100644 --- a/nixos/modules/installer/virtualbox-demo.nix +++ b/nixos/modules/installer/virtualbox-demo.nix @@ -21,5 +21,5 @@ with lib; services.xserver.videoDrivers = mkOverride 40 [ "virtualbox" "vmware" "cirrus" "vesa" "modesetting" ]; powerManagement.enable = false; - system.nixos.stateVersion = mkDefault "18.03"; + system.stateVersion = mkDefault "18.03"; } diff --git a/nixos/modules/misc/version.nix b/nixos/modules/misc/version.nix index 33d8a7861693..3be12e4a6375 100644 --- a/nixos/modules/misc/version.nix +++ b/nixos/modules/misc/version.nix @@ -12,29 +12,29 @@ in { - options.system.nixos = { + options.system = { - version = mkOption { + nixos.version = mkOption { internal = true; type = types.str; description = "The full NixOS version (e.g. <literal>16.03.1160.f2d4ee1</literal>)."; }; - release = mkOption { + nixos.release = mkOption { readOnly = true; type = types.str; default = trivial.release; description = "The NixOS release (e.g. <literal>16.03</literal>)."; }; - versionSuffix = mkOption { + nixos.versionSuffix = mkOption { internal = true; type = types.str; default = trivial.versionSuffix; description = "The NixOS version suffix (e.g. <literal>1160.f2d4ee1</literal>)."; }; - revision = mkOption { + nixos.revision = mkOption { internal = true; type = types.str; default = if pathIsDirectory gitRepo then commitIdFromGitRepo gitRepo @@ -43,7 +43,7 @@ in description = "The Git revision from which this NixOS configuration was built."; }; - codeName = mkOption { + nixos.codeName = mkOption { readOnly = true; type = types.str; description = "The NixOS release code name (e.g. <literal>Emu</literal>)."; @@ -76,8 +76,8 @@ in config = { - warnings = lib.optional (options.system.nixos.stateVersion.highestPrio > 1000) - "You don't have `system.nixos.stateVersion` explicitly set. Expect things to break."; + warnings = lib.optional (options.system.stateVersion.highestPrio > 1000) + "You don't have `system.stateVersion` explicitly set. Expect things to break."; system.nixos = { # These defaults are set here rather than up there so that diff --git a/nixos/modules/programs/shell.nix b/nixos/modules/programs/shell.nix index 3b5212c9e76b..944a8bdf16fc 100644 --- a/nixos/modules/programs/shell.nix +++ b/nixos/modules/programs/shell.nix @@ -34,7 +34,7 @@ with lib; # Subscribe the root user to the NixOS channel by default. if [ "$USER" = root -a ! -e "$HOME/.nix-channels" ]; then - echo "${config.system.nixos.defaultChannel} nixos" > "$HOME/.nix-channels" + echo "${config.system.defaultChannel} nixos" > "$HOME/.nix-channels" fi # Create the per-user garbage collector roots directory. diff --git a/nixos/modules/rename.nix b/nixos/modules/rename.nix index 5242444a60b8..87ff4359edaf 100644 --- a/nixos/modules/rename.nix +++ b/nixos/modules/rename.nix @@ -222,8 +222,6 @@ with lib; (mkRenamedOptionModule [ "system" "nixosVersionSuffix" ] [ "system" "nixos" "versionSuffix" ]) (mkRenamedOptionModule [ "system" "nixosRevision" ] [ "system" "nixos" "revision" ]) (mkRenamedOptionModule [ "system" "nixosLabel" ] [ "system" "nixos" "label" ]) - (mkRenamedOptionModule [ "system" "stateVersion" ] [ "system" "nixos" "stateVersion" ]) - (mkRenamedOptionModule [ "system" "defaultChannel" ] [ "system" "nixos" "defaultChannel" ]) # Users (mkAliasOptionModule [ "users" "extraUsers" ] [ "users" "users" ]) diff --git a/nixos/modules/services/databases/mysql.nix b/nixos/modules/services/databases/mysql.nix index 3eb7879e2d9f..0dde9ee6e2e5 100644 --- a/nixos/modules/services/databases/mysql.nix +++ b/nixos/modules/services/databases/mysql.nix @@ -218,7 +218,7 @@ in config = mkIf config.services.mysql.enable { services.mysql.dataDir = - mkDefault (if versionAtLeast config.system.nixos.stateVersion "17.09" then "/var/lib/mysql" + mkDefault (if versionAtLeast config.system.stateVersion "17.09" then "/var/lib/mysql" else "/var/mysql"); users.users.mysql = { diff --git a/nixos/modules/services/databases/postgresql.nix b/nixos/modules/services/databases/postgresql.nix index e33bee9db6e9..f59fb1c81772 100644 --- a/nixos/modules/services/databases/postgresql.nix +++ b/nixos/modules/services/databases/postgresql.nix @@ -146,7 +146,7 @@ in }; superUser = mkOption { type = types.str; - default= if versionAtLeast config.system.nixos.stateVersion "17.09" then "postgres" else "root"; + default= if versionAtLeast config.system.stateVersion "17.09" then "postgres" else "root"; internal = true; description = '' NixOS traditionally used 'root' as superuser, most other distros use 'postgres'. @@ -165,14 +165,14 @@ in services.postgresql.package = # Note: when changing the default, make it conditional on - # ‘system.nixos.stateVersion’ to maintain compatibility with existing + # ‘system.stateVersion’ to maintain compatibility with existing # systems! - mkDefault (if versionAtLeast config.system.nixos.stateVersion "17.09" then pkgs.postgresql96 - else if versionAtLeast config.system.nixos.stateVersion "16.03" then pkgs.postgresql95 + mkDefault (if versionAtLeast config.system.stateVersion "17.09" then pkgs.postgresql96 + else if versionAtLeast config.system.stateVersion "16.03" then pkgs.postgresql95 else pkgs.postgresql94); services.postgresql.dataDir = - mkDefault (if versionAtLeast config.system.nixos.stateVersion "17.09" then "/var/lib/postgresql/${config.services.postgresql.package.psqlSchema}" + mkDefault (if versionAtLeast config.system.stateVersion "17.09" then "/var/lib/postgresql/${config.services.postgresql.package.psqlSchema}" else "/var/db/postgresql"); services.postgresql.authentication = mkAfter diff --git a/nixos/modules/services/misc/matrix-synapse.nix b/nixos/modules/services/misc/matrix-synapse.nix index 3e3de9114708..18e13f6ac030 100644 --- a/nixos/modules/services/misc/matrix-synapse.nix +++ b/nixos/modules/services/misc/matrix-synapse.nix @@ -342,7 +342,7 @@ in { }; database_type = mkOption { type = types.enum [ "sqlite3" "psycopg2" ]; - default = if versionAtLeast config.system.nixos.stateVersion "18.03" + default = if versionAtLeast config.system.stateVersion "18.03" then "psycopg2" else "sqlite3"; description = '' diff --git a/nixos/modules/services/network-filesystems/ipfs.nix b/nixos/modules/services/network-filesystems/ipfs.nix index 21b664e5b2f9..412d57b27b82 100644 --- a/nixos/modules/services/network-filesystems/ipfs.nix +++ b/nixos/modules/services/network-filesystems/ipfs.nix @@ -14,7 +14,7 @@ let (optionalString (cfg.defaultMode == "norouting") "--routing=none") ] ++ cfg.extraFlags); - defaultDataDir = if versionAtLeast config.system.nixos.stateVersion "17.09" then + defaultDataDir = if versionAtLeast config.system.stateVersion "17.09" then "/var/lib/ipfs" else "/var/lib/ipfs/.ipfs"; diff --git a/nixos/modules/services/networking/radicale.nix b/nixos/modules/services/networking/radicale.nix index 2afab5ee3b3e..d6fabbcd4700 100644 --- a/nixos/modules/services/networking/radicale.nix +++ b/nixos/modules/services/networking/radicale.nix @@ -9,7 +9,7 @@ let confFile = pkgs.writeText "radicale.conf" cfg.config; # This enables us to default to version 2 while still not breaking configurations of people with version 1 - defaultPackage = if versionAtLeast config.system.nixos.stateVersion "17.09" then { + defaultPackage = if versionAtLeast config.system.stateVersion "17.09" then { pkg = pkgs.radicale2; text = "pkgs.radicale2"; } else { @@ -35,7 +35,7 @@ in defaultText = defaultPackage.text; description = '' Radicale package to use. This defaults to version 1.x if - <literal>system.nixos.stateVersion < 17.09</literal> and version 2.x + <literal>system.stateVersion < 17.09</literal> and version 2.x otherwise. ''; }; diff --git a/nixos/modules/services/web-servers/caddy.nix b/nixos/modules/services/web-servers/caddy.nix index 4237cfdd9198..d0b936cb019f 100644 --- a/nixos/modules/services/web-servers/caddy.nix +++ b/nixos/modules/services/web-servers/caddy.nix @@ -66,7 +66,7 @@ in { description = "Caddy web server"; after = [ "network-online.target" ]; wantedBy = [ "multi-user.target" ]; - environment = mkIf (versionAtLeast config.system.nixos.stateVersion "17.09") + environment = mkIf (versionAtLeast config.system.stateVersion "17.09") { CADDYPATH = cfg.dataDir; }; serviceConfig = { ExecStart = '' diff --git a/nixos/modules/testing/test-instrumentation.nix b/nixos/modules/testing/test-instrumentation.nix index 114e0ca39fa2..d94e21d681f3 100644 --- a/nixos/modules/testing/test-instrumentation.nix +++ b/nixos/modules/testing/test-instrumentation.nix @@ -127,7 +127,7 @@ with import ../../lib/qemu-flags.nix { inherit pkgs; }; services.xserver.displayManager.job.logToJournal = true; # set default stateVersion to avoid warnings during eval - system.nixos.stateVersion = mkDefault "18.03"; + system.stateVersion = mkDefault "18.03"; }; } diff --git a/nixos/modules/virtualisation/amazon-options.nix b/nixos/modules/virtualisation/amazon-options.nix index 1a45c3093b78..15de8638bbab 100644 --- a/nixos/modules/virtualisation/amazon-options.nix +++ b/nixos/modules/virtualisation/amazon-options.nix @@ -3,7 +3,7 @@ options = { ec2 = { hvm = lib.mkOption { - default = lib.versionAtLeast config.system.nixos.stateVersion "17.03"; + default = lib.versionAtLeast config.system.stateVersion "17.03"; internal = true; description = '' Whether the EC2 instance is a HVM instance. diff --git a/nixos/modules/virtualisation/containers.nix b/nixos/modules/virtualisation/containers.nix index 31f5f6fe7807..b91165ce3b82 100644 --- a/nixos/modules/virtualisation/containers.nix +++ b/nixos/modules/virtualisation/containers.nix @@ -607,7 +607,7 @@ in { services.postgresql.enable = true; services.postgresql.package = pkgs.postgresql96; - system.nixos.stateVersion = "17.03"; + system.stateVersion = "17.03"; }; }; } |