diff --git a/modules/discord/nixcord.nix b/modules/discord/nixcord.nix index b7409bce..3aeb621c 100644 --- a/modules/discord/nixcord.nix +++ b/modules/discord/nixcord.nix @@ -32,7 +32,7 @@ mkTarget { lib.mkIf (cfg.themeBody != (import ./common/theme-header.nix) || cfg.extraCss != "") ( - lib.optionalAttrs (builtins.hasAttr "nixcord" options.programs) ( + lib.optionalAttrs (options.programs ? nixcord) ( lib.mkMerge [ (lib.mkIf nixcord.discord.enable ( lib.mkMerge [ diff --git a/modules/zen-browser/hm.nix b/modules/zen-browser/hm.nix index 9945e4f3..71c6f190 100644 --- a/modules/zen-browser/hm.nix +++ b/modules/zen-browser/hm.nix @@ -19,48 +19,46 @@ mkTarget { }; }; - configElements = - lib.optionals (builtins.hasAttr "zen-browser" options.programs) - [ - ( - { cfg }: - { - warnings = - lib.optional (config.programs.zen-browser.enable && cfg.profileNames == [ ]) - ''stylix: zen-browser: `config.stylix.targets.zen-browser.profileNames` is not set. Declare profile names with 'config.stylix.targets.zen-browser.profileNames = [ "" ];'.''; - } - ) - ( - { - cfg, - fonts, - }: - { - programs.zen-browser.profiles = lib.genAttrs cfg.profileNames (_: { - settings = { - "font.name.monospace.x-western" = fonts.monospace.name; - "font.name.sans-serif.x-western" = fonts.sansSerif.name; - "font.name.serif.x-western" = fonts.serif.name; - }; - }); - } - ) - ( - { - cfg, - colors, - }: - { - programs.zen-browser.profiles = lib.genAttrs cfg.profileNames (_: { - settings = { - "toolkit.legacyUserProfileCustomizations.stylesheets" = true; - }; + configElements = lib.optionals (options.programs ? zen-browser) [ + ( + { cfg }: + { + warnings = + lib.optional (config.programs.zen-browser.enable && cfg.profileNames == [ ]) + ''stylix: zen-browser: `config.stylix.targets.zen-browser.profileNames` is not set. Declare profile names with 'config.stylix.targets.zen-browser.profileNames = [ "" ];'.''; + } + ) + ( + { + cfg, + fonts, + }: + { + programs.zen-browser.profiles = lib.genAttrs cfg.profileNames (_: { + settings = { + "font.name.monospace.x-western" = fonts.monospace.name; + "font.name.sans-serif.x-western" = fonts.sansSerif.name; + "font.name.serif.x-western" = fonts.serif.name; + }; + }); + } + ) + ( + { + cfg, + colors, + }: + { + programs.zen-browser.profiles = lib.genAttrs cfg.profileNames (_: { + settings = { + "toolkit.legacyUserProfileCustomizations.stylesheets" = true; + }; - userChrome = import ./userChrome.nix { inherit colors; }; + userChrome = import ./userChrome.nix { inherit colors; }; - userContent = import ./userContent.nix { inherit colors; }; - }); - } - ) - ]; + userContent = import ./userContent.nix { inherit colors; }; + }); + } + ) + ]; }