diff --git a/lib/modules/programs.nix b/lib/modules/programs.nix index 2a6a1eba..69600516 100644 --- a/lib/modules/programs.nix +++ b/lib/modules/programs.nix @@ -5,17 +5,20 @@ let mkUsersOption = programs: osConfig: mkOption { type = types.attrsOf (types.submodule ( - { ... }: { + { config, ... }: { options = { inherit programs; }; config = { - programs = builtins.mapAttrs + programs = lib.attrsets.concatMapAttrs ( - name: config: { - enable = mkDefault config.enable; - } + name: program: + if (builtins.elem name (builtins.attrNames config.programs)) then { + ${name} = { + enable = mkDefault program.enable; + }; + } else { } ) osConfig.programs; };