From abb58fdc282a79f313144e11489d4e0aee960d23 Mon Sep 17 00:00:00 2001 From: rnhmjoj Date: Sun, 21 Jun 2020 15:28:54 +0200 Subject: nixos/users-groups: remove ancient security.initialRootPassword option This option has been deprecated for a long time because is redundant (users.users.root.initialHashedPassword exists). Moreover, being of type string, it required to handle the special value "!" separately, instead of using just `null`. (cherry picked from commit a6ed7d4845f1142f36b2c461d5a721bc68eb7d48) --- nixpkgs/nixos/modules/config/users-groups.nix | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/nixpkgs/nixos/modules/config/users-groups.nix b/nixpkgs/nixos/modules/config/users-groups.nix index 8defa86818ab..d9261e16773d 100644 --- a/nixpkgs/nixos/modules/config/users-groups.nix +++ b/nixpkgs/nixos/modules/config/users-groups.nix @@ -406,6 +406,12 @@ in { imports = [ (mkAliasOptionModule [ "users" "extraUsers" ] [ "users" "users" ]) (mkAliasOptionModule [ "users" "extraGroups" ] [ "users" "groups" ]) + (mkChangedOptionModule + [ "security" "initialRootPassword" ] + [ "users" "users" "root" "initialHashedPassword" ] + (cfg: if cfg.security.initialHashedPassword == "!" + then null + else cfg.security.initialHashedPassword)) ]; ###### interface @@ -477,14 +483,6 @@ in { ''; }; - # FIXME: obsolete - will remove. - security.initialRootPassword = mkOption { - type = types.str; - default = "!"; - example = ""; - visible = false; - }; - }; @@ -499,7 +497,6 @@ in { home = "/root"; shell = mkDefault cfg.defaultUserShell; group = "root"; - initialHashedPassword = mkDefault config.security.initialRootPassword; }; nobody = { uid = ids.uids.nobody; @@ -588,7 +585,7 @@ in { || cfg.group == "wheel" || elem "wheel" cfg.extraGroups) && - ((cfg.hashedPassword != null && cfg.hashedPassword != "!") + (cfg.hashedPassword != null || cfg.password != null || cfg.passwordFile != null || cfg.openssh.authorizedKeys.keys != [] -- cgit 1.4.1