Browse Source

* That wasn't quite right.

svn path=/nixos/branches/modular-nixos/; revision=15770
nsd-state-dir
Eelco Dolstra 14 years ago
parent
commit
e86b066625
  1. 31
      modules/config/guest-users.nix

31
modules/config/guest-users.nix

@ -33,9 +33,10 @@ let
};
};
};
inherit (pkgs.lib) concatStringsSep optional optionalString;
inherit (pkgs.lib) concatStringsSep optionalString;
inherit (config.services.guestUsers) enable users includeRoot extraGroups;
cfg = config.services.guestUsers;
userEntry = user:
{
@ -44,25 +45,29 @@ let
home = "/home/${user}";
createHome = true;
group = "users";
extraGroups = extraGroups;
extraGroups = cfg.extraGroups;
shell = "/bin/sh";
};
nameString = (concatStringsSep " " users) + optionalString includeRoot " root";
nameString = (concatStringsSep " " cfg.users) + optionalString cfg.includeRoot " root";
in
{
pkgs.lib.mkIf cfg.enable {
require = options;
system.activationScripts = pkgs.lib.fullDepEntry
''
for i in ${nameString}; do
echo | ${pkgs.pwdutils}/bin/passwd --stdin $i
done
'' ["defaultPath" "users" "groups"];
system.activationScripts = {
clearPasswords = pkgs.lib.fullDepEntry
''
for i in ${nameString}; do
echo | ${pkgs.pwdutils}/bin/passwd --stdin $i
done
'' ["defaultPath" "users" "groups"];
};
services.mingetty.helpLine = optionalString enable "\nThese users have empty passwords: ${nameString}";
services.mingetty.helpLine = "\nThese users have empty passwords: ${nameString}";
users.extraUsers = map userEntry users;
users.extraUsers = map userEntry cfg.users;
}
Loading…
Cancel
Save