diff --git a/modules/nixos/configs/security.nix b/modules/nixos/configs/security.nix index 0a806c3..b4f9319 100644 --- a/modules/nixos/configs/security.nix +++ b/modules/nixos/configs/security.nix @@ -9,7 +9,7 @@ in type = types.listOf (types.submodule { options = { commands = mkOption { - type = listOf (types.either types.str types.package); + type = with types; listOf (either str package); }; groups = mkOption { 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: { inherit (rule) groups; - commands = lib.flip map rule.commands (cmd: [ + commands = lib.flip map rule.commands (cmd: { command = "${cmd}"; options = [ "NOPASSWD" ]; } - ]); + ); }); };