modules: replace static builtins.hasAttrs instances with '?' operator (#1913)
Fixes:c32c82e460("zen-browser: init (#1694)") Fixes:e594886eb0("nixcord: init (#767)") Link: https://github.com/nix-community/stylix/pull/1913 Reviewed-by: awwpotato <awwpotato@voidq.com>
This commit is contained in:
parent
5b9710eee9
commit
bae3064215
2 changed files with 41 additions and 43 deletions
|
|
@ -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 [
|
||||
|
|
|
|||
|
|
@ -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 = [ "<PROFILE_NAME>" ];'.'';
|
||||
}
|
||||
)
|
||||
(
|
||||
{
|
||||
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 = [ "<PROFILE_NAME>" ];'.'';
|
||||
}
|
||||
)
|
||||
(
|
||||
{
|
||||
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; };
|
||||
});
|
||||
}
|
||||
)
|
||||
];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue