From f8f787b800dce2a2402a0cb693e9fe0b6895c4a7 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 3 Nov 2014 12:19:25 +0100 Subject: Handle initialPassword and initialHashedPassword for !mutableUsers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In this case, they're equivalent to setting ‘password’ and ‘hashedPassword’ (since there is no distinction between an initial and non-initial user account state). --- nixos/modules/config/users-groups.nix | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'nixos') diff --git a/nixos/modules/config/users-groups.nix b/nixos/modules/config/users-groups.nix index 43c927cb7692..60906d48ff0c 100644 --- a/nixos/modules/config/users-groups.nix +++ b/nixos/modules/config/users-groups.nix @@ -235,6 +235,14 @@ let useDefaultShell = mkDefault true; isSystemUser = mkDefault false; }) + # If !mutableUsers, setting ‘initialPassword’ is equivalent to + # setting ‘password’ (and similarly for hashed passwords). + (mkIf (!cfg.mutableUsers && config.initialPassword != null) { + password = mkDefault config.initialPassword; + }) + (mkIf (!cfg.mutableUsers && config.initialHashedPassword != null) { + hashedPassword = mkDefault config.initialHashedPassword; + }) ]; }; -- cgit 1.4.1