11.stylix/modules/swaync/hm.nix
NAHO dfc859f54d
treewide: optionalize mkTarget's humanName and name arguments
Optionalize mkTarget's 'humanName' and 'name' arguments by inferring
'humanName' from the 'name' attribute in the /modules/<MODULE>/meta.nix
file, and 'name' from the /modules/<NAME>/ directory name.

Inferring the 'humanName' and 'name' arguments ensures consistency and
reduces boilerplate.

The 'humanName' and 'name' arguments are optionalized instead of removed
because complex modules generating target derivations need to
distinguish between them.

Closes: https://github.com/nix-community/stylix/issues/1661
2025-12-10 14:48:37 +01:00

35 lines
1 KiB
Nix

{ mkTarget, ... }:
mkTarget {
config = [
(
{ fonts }:
{
services.swaync.style = ''
* {
font-family: "${fonts.sansSerif.name}";
font-size: ${toString fonts.sizes.desktop}pt;
}
'';
}
)
(
{ colors }:
{
services.swaync.style =
with colors.withHashtag;
''
@define-color base00 ${base00}; @define-color base01 ${base01};
@define-color base02 ${base02}; @define-color base03 ${base03};
@define-color base04 ${base04}; @define-color base05 ${base05};
@define-color base06 ${base06}; @define-color base07 ${base07};
@define-color base08 ${base08}; @define-color base09 ${base09};
@define-color base0A ${base0A}; @define-color base0B ${base0B};
@define-color base0C ${base0C}; @define-color base0D ${base0D};
@define-color base0E ${base0E}; @define-color base0F ${base0F};
''
+ (builtins.readFile ./base.css);
}
)
];
}