Revert "nixos: rename system.{stateVersion,defaultChannel} -> system.nixos.\1"

This reverts commit 095fe5b43d.

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...
wip/yesman
Tuomas Tynkkynen 6 years ago committed by Tuomas Tynkkynen
parent 28e11a0b6b
commit 96190535e5
  1. 2
      nixos/doc/manual/development/releases.xml
  2. 4
      nixos/doc/manual/release-notes/rl-1509.xml
  3. 2
      nixos/modules/installer/cd-dvd/installation-cd-base.nix
  4. 2
      nixos/modules/installer/tools/nixos-generate-config.pl
  5. 2
      nixos/modules/installer/virtualbox-demo.nix
  6. 16
      nixos/modules/misc/version.nix
  7. 2
      nixos/modules/programs/shell.nix
  8. 2
      nixos/modules/rename.nix
  9. 2
      nixos/modules/services/databases/mysql.nix
  10. 10
      nixos/modules/services/databases/postgresql.nix
  11. 2
      nixos/modules/services/misc/matrix-synapse.nix
  12. 2
      nixos/modules/services/network-filesystems/ipfs.nix
  13. 4
      nixos/modules/services/networking/radicale.nix
  14. 2
      nixos/modules/services/web-servers/caddy.nix
  15. 2
      nixos/modules/testing/test-instrumentation.nix
  16. 2
      nixos/modules/virtualisation/amazon-options.nix
  17. 2
      nixos/modules/virtualisation/containers.nix
  18. 2
      nixos/release.nix
  19. 2
      nixos/tests/containers-imperative.nix
  20. 2
      nixos/tests/containers-ipv4.nix
  21. 4
      nixos/tests/radicale.nix

@ -70,7 +70,7 @@
<listitem>
<para>
<link xlink:href="https://github.com/NixOS/nixpkgs/compare/bdf161ed8d21...6b63c4616790">
Bump the <literal>system.nixos.defaultChannel</literal> attribute in
Bump the <literal>system.defaultChannel</literal> attribute in
<literal>nixos/modules/misc/version.nix</literal> </link>
</para>
</listitem>

@ -433,9 +433,9 @@ system.autoUpgrade.enable = true;
default. If you have existing systems with such host keys and want to
continue to use them, please set
<programlisting>
system.nixos.stateVersion = "14.12";
system.stateVersion = "14.12";
</programlisting>
The new option <option>system.nixos.stateVersion</option> ensures that
The new option <option>system.stateVersion</option> ensures that
certain configuration changes that could break existing systems (such as
the <command>sshd</command> host key setting) will maintain compatibility
with the specified NixOS release. NixOps sets the state version of

@ -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";
}

@ -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

@ -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";
}

@ -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

@ -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.

@ -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" ])

@ -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 = {

@ -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

@ -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 = ''

@ -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";

@ -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 &lt; 17.09</literal> and version 2.x
<literal>system.stateVersion &lt; 17.09</literal> and version 2.x
otherwise.
'';
};

@ -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 = ''

@ -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";
};
}

@ -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.

@ -607,7 +607,7 @@ in
{ services.postgresql.enable = true;
services.postgresql.package = pkgs.postgresql96;
system.nixos.stateVersion = "17.03";
system.stateVersion = "17.03";
};
};
}

@ -198,7 +198,7 @@ in rec {
modules = singleton ({ ... }:
{ fileSystems."/".device = mkDefault "/dev/sda1";
boot.loader.grub.device = mkDefault "/dev/sda";
system.nixos.stateVersion = mkDefault "18.03";
system.stateVersion = mkDefault "18.03";
});
}).config.system.build.toplevel;
preferLocalBuild = true;

@ -18,7 +18,7 @@ import ./make-test.nix ({ pkgs, ...} : {
inherit (config.nixpkgs.localSystem) system;
modules = lib.singleton {
containers.foo.config = {
system.nixos.stateVersion = "18.03";
system.stateVersion = "18.03";
};
};
};

@ -21,7 +21,7 @@ import ./make-test.nix ({ pkgs, ...} : {
services.httpd.adminAddr = "foo@example.org";
networking.firewall.allowedTCPPorts = [ 80 ];
networking.firewall.allowPing = true;
system.nixos.stateVersion = "18.03";
system.stateVersion = "18.03";
};
};

@ -43,7 +43,7 @@ in
});
})
];
system.nixos.stateVersion = "17.03";
system.stateVersion = "17.03";
};
radicale1_export = lib.recursiveUpdate radicale1 {
services.radicale.extraArgs = [
@ -54,7 +54,7 @@ in
services.radicale.extraArgs = [ "--verify-storage" ];
};
radicale2 = lib.recursiveUpdate (common args) {
system.nixos.stateVersion = "17.09";
system.stateVersion = "17.09";
};
};

Loading…
Cancel
Save