modules/security: fix types
This commit is contained in:
parent
fe3043c6a4
commit
e813ce3c9a
1 changed files with 4 additions and 4 deletions
|
@ -9,7 +9,7 @@ in
|
||||||
type = types.listOf (types.submodule {
|
type = types.listOf (types.submodule {
|
||||||
options = {
|
options = {
|
||||||
commands = mkOption {
|
commands = mkOption {
|
||||||
type = listOf (types.either types.str types.package);
|
type = with types; listOf (either str package);
|
||||||
};
|
};
|
||||||
groups = mkOption {
|
groups = mkOption {
|
||||||
type = types.listOf types.str;
|
type = types.listOf types.str;
|
||||||
|
@ -21,15 +21,15 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = cfg.nopasswd != [ ] {
|
config = lib.mkIf (cfg.nopasswd != [ ]) {
|
||||||
security.sudo.extraRules = lib.flip map cfg.nopasswd (rule: {
|
security.sudo.extraRules = lib.flip map cfg.nopasswd (rule: {
|
||||||
inherit (rule) groups;
|
inherit (rule) groups;
|
||||||
commands = lib.flip map rule.commands (cmd: [
|
commands = lib.flip map rule.commands (cmd:
|
||||||
{
|
{
|
||||||
command = "${cmd}";
|
command = "${cmd}";
|
||||||
options = [ "NOPASSWD" ];
|
options = [ "NOPASSWD" ];
|
||||||
}
|
}
|
||||||
]);
|
);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue