diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-11-03 11:59:38 +0100 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-11-03 12:32:19 +0100 |
commit | 1b53a3fcb7d6f1f31c4178131d8dff2177c81060 (patch) | |
tree | 8bcdf7e26c74808ea6a58786cce787dc2c1936df /nixos/modules/config/update-users-groups.pl | |
parent | cb981b9dad4bd0e64a01b1abc14d2008151a2aa7 (diff) |
Add initialPassword and initialHashedPassword options
These are like password and hashedPassword, except that they only
apply when the user is initially created.
Diffstat (limited to 'nixos/modules/config/update-users-groups.pl')
-rw-r--r-- | nixos/modules/config/update-users-groups.pl | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/nixos/modules/config/update-users-groups.pl b/nixos/modules/config/update-users-groups.pl index abcb082af8e5..9f91dbe1b569 100644 --- a/nixos/modules/config/update-users-groups.pl +++ b/nixos/modules/config/update-users-groups.pl @@ -169,6 +169,12 @@ foreach my $u (@{$spec->{users}}) { } else { $u->{uid} = allocUid($u->{isSystemUser}) if !defined $u->{uid}; + if (defined $u->{initialPassword}) { + $u->{hashedPassword} = hashPassword($u->{initialPassword}); + } elsif (defined $u->{initialHashedPassword}) { + $u->{hashedPassword} = $u->{initialHashedPassword}; + } + # Create a home directory. if ($u->{createHome}) { make_path($u->{home}, { mode => 0700 }) if ! -e $u->{home}; |