From e813ce3c9ade475f230623693121f2e97dce74a0 Mon Sep 17 00:00:00 2001 From: Dmitriy Pleshevskiy Date: Sun, 29 Sep 2024 15:21:11 +0300 Subject: [PATCH] modules/security: fix types --- modules/nixos/configs/security.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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" ]; } - ]); + ); }); };