11.stylix/modules/vicinae/hm.nix
Alexander 55380d322f vicinae: support Home Manager module alongside upstream module (#2068)
Support the Home Manager module via programs.vicinae alongside the
upstream module's services.vicinae namespace.

Unifying both modules is continued in [1] ("vicinae: move from programs
to services").

[1]: https://github.com/nix-community/home-manager/pull/8313

Closes: https://github.com/nix-community/stylix/issues/2076
Link: https://github.com/nix-community/stylix/pull/2068

Reviewed-by: 0xda157 <da157@voidq.com>
Reviewed-by: NAHO <90870942+trueNAHO@users.noreply.github.com>
(cherry picked from commit a4406d9799)
2026-01-08 16:42:03 +01:00

60 lines
1.6 KiB
Nix

{
mkTarget,
lib,
options,
...
}:
mkTarget {
config =
let
eachConfig =
config:
lib.genAttrs [ "services" "programs" ] (
source: lib.optionalAttrs (options.${source} ? vicinae) { vicinae = config; }
);
in
[
(
{ colors, polarity }:
eachConfig {
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 }: eachConfig { settings.window.opacity = opacity.popups; })
];
}