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
41 lines
1.1 KiB
Nix
41 lines
1.1 KiB
Nix
{ mkTarget, lib, ... }:
|
|
mkTarget {
|
|
# Referenced https://github.com/stacyharper/base16-mako
|
|
config = [
|
|
(
|
|
{ fonts }:
|
|
{
|
|
services.mako.settings.font = "${fonts.sansSerif.name} ${toString fonts.sizes.popups}";
|
|
}
|
|
)
|
|
(
|
|
{ colors, opacity }:
|
|
{
|
|
services.mako =
|
|
let
|
|
makoOpacity = lib.toHexString (builtins.ceil (opacity.popups * 255));
|
|
in
|
|
with colors.withHashtag;
|
|
{
|
|
settings = {
|
|
background-color = base00 + makoOpacity;
|
|
border-color = base0D;
|
|
text-color = base05;
|
|
progress-color = "over ${base02}";
|
|
|
|
"urgency=low" = {
|
|
background-color = "${base00}${makoOpacity}";
|
|
border-color = base03;
|
|
text-color = base05;
|
|
};
|
|
"urgency=critical" = {
|
|
background-color = "${base00}${makoOpacity}";
|
|
border-color = base08;
|
|
text-color = base05;
|
|
};
|
|
};
|
|
};
|
|
}
|
|
)
|
|
];
|
|
}
|