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
58 lines
1.5 KiB
Nix
58 lines
1.5 KiB
Nix
{
|
|
mkTarget,
|
|
lib,
|
|
options,
|
|
...
|
|
}:
|
|
mkTarget {
|
|
config = lib.optionals (options.services ? vicinae) [
|
|
(
|
|
{ colors, polarity }:
|
|
{
|
|
services.vicinae = {
|
|
settings.theme.name = "stylix";
|
|
themes.stylix = {
|
|
meta = {
|
|
name = "stylix";
|
|
description = "theme generated by stylix";
|
|
variant = if polarity == "either" then "light" else polarity;
|
|
};
|
|
colors = with colors.withHashtag; {
|
|
core = {
|
|
background = base00;
|
|
foreground = base05;
|
|
secondary_background = base01;
|
|
border = base02;
|
|
accent = base0D;
|
|
};
|
|
accents = {
|
|
# TODO: magenta and purple shouldn't be the same color
|
|
blue = base0D;
|
|
green = base0B;
|
|
magenta = base0E;
|
|
orange = base09;
|
|
purple = base0E;
|
|
red = base08;
|
|
yellow = base0A;
|
|
cyan = base0C;
|
|
};
|
|
list.item = {
|
|
selection = {
|
|
background.name = base02;
|
|
secondary_background = base03;
|
|
};
|
|
hover.background = base01;
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|
|
)
|
|
(
|
|
{ opacity }:
|
|
{
|
|
services.vicinae.settings.window.opacity = opacity.popups;
|
|
}
|
|
)
|
|
];
|
|
}
|