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
47 lines
1.1 KiB
Nix
47 lines
1.1 KiB
Nix
{ mkTarget, lib, ... }:
|
|
mkTarget {
|
|
config = [
|
|
(
|
|
{ fonts }:
|
|
{
|
|
services.dunst.settings.global.font =
|
|
"${fonts.sansSerif.name} ${toString fonts.sizes.popups}";
|
|
}
|
|
)
|
|
(
|
|
{ colors, opacity }:
|
|
{
|
|
services.dunst.settings =
|
|
with colors.withHashtag;
|
|
let
|
|
dunstOpacity = lib.toHexString (
|
|
((builtins.floor (opacity.popups * 100 + 0.5)) * 255) / 100
|
|
);
|
|
in
|
|
{
|
|
global = {
|
|
separator_color = base02;
|
|
};
|
|
|
|
urgency_low = {
|
|
background = base01 + dunstOpacity;
|
|
foreground = base05;
|
|
frame_color = base03;
|
|
};
|
|
|
|
urgency_normal = {
|
|
background = base01 + dunstOpacity;
|
|
foreground = base05;
|
|
frame_color = base0D;
|
|
};
|
|
|
|
urgency_critical = {
|
|
background = base01 + dunstOpacity;
|
|
foreground = base05;
|
|
frame_color = base08;
|
|
};
|
|
};
|
|
}
|
|
)
|
|
];
|
|
}
|