lib/users: add option c3d2.allUsersCanSshRoot
This commit is contained in:
parent
033c81399d
commit
dacb4ca655
|
@ -24,5 +24,21 @@ in {
|
|||
};
|
||||
in listToAttrs (map f userNames);
|
||||
|
||||
config = lib.mkMerge (map import' userNames);
|
||||
options.c3d2.allUsersCanSshRoot = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
description = ''
|
||||
Let all people in `lib/users/` login as root for deployment via SSH.
|
||||
'';
|
||||
};
|
||||
|
||||
config = lib.mkMerge ([ {
|
||||
users.users.root = lib.mkIf config.c3d2.allUsersCanSshRoot {
|
||||
openssh = lib.mkMerge (map (name:
|
||||
let
|
||||
userConf = (import' name).content.users.users.${name};
|
||||
in lib.optionalAttrs (userConf ? openssh) userConf.openssh
|
||||
) userNames);
|
||||
};
|
||||
} ] ++ map import' userNames);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue