Merge pull request #41966 from aneeshusa/allow-mutable-shells-for-declarative-users
nixos/users: Allow mutable shells for declarative users
This commit is contained in:
commit
9206c0d115
@ -227,6 +227,15 @@ foreach my $u (@{$spec->{users}}) {
|
|||||||
$u->{hashedPassword} = hashPassword($u->{password});
|
$u->{hashedPassword} = hashPassword($u->{password});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!defined $u->{shell}) {
|
||||||
|
if (defined $existing) {
|
||||||
|
$u->{shell} = $existing->{shell};
|
||||||
|
} else {
|
||||||
|
warn "warning: no declarative or previous shell for ‘$name’, setting shell to nologin\n";
|
||||||
|
$u->{shell} = "/run/current-system/sw/bin/nologin";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$u->{fakePassword} = $existing->{fakePassword} // "x";
|
$u->{fakePassword} = $existing->{fakePassword} // "x";
|
||||||
$usersOut{$name} = $u;
|
$usersOut{$name} = $u;
|
||||||
|
|
||||||
|
@ -153,7 +153,7 @@ let
|
|||||||
};
|
};
|
||||||
|
|
||||||
shell = mkOption {
|
shell = mkOption {
|
||||||
type = types.either types.shellPackage types.path;
|
type = types.nullOr (types.either types.shellPackage types.path);
|
||||||
default = pkgs.shadow;
|
default = pkgs.shadow;
|
||||||
defaultText = "pkgs.shadow";
|
defaultText = "pkgs.shadow";
|
||||||
example = literalExample "pkgs.bashInteractive";
|
example = literalExample "pkgs.bashInteractive";
|
||||||
|
Loading…
Reference in New Issue
Block a user