44 lines
1.2 KiB
Nix
44 lines
1.2 KiB
Nix
|
{
|
||
|
config,
|
||
|
lib,
|
||
|
...
|
||
|
}: let
|
||
|
inherit (config.rose-pine) sources;
|
||
|
|
||
|
cfg = config.services.swaync.rose-pine;
|
||
|
enable = cfg.enable && config.services.swaync.enable;
|
||
|
|
||
|
styleFile = "${sources.swaync}/theme/${lib.rp.getKebabTheme cfg.flavor}.css";
|
||
|
in {
|
||
|
options.services.swaync.rose-pine =
|
||
|
lib.rp.mkRosePineOpt {name = "swaync";}
|
||
|
// {
|
||
|
mode = lib.mkOption {
|
||
|
type = lib.types.enum [
|
||
|
"prependImport"
|
||
|
"createLink"
|
||
|
];
|
||
|
default = "prependImport";
|
||
|
description = ''
|
||
|
Defines how to include the Rosé Pine theme css file:
|
||
|
|
||
|
- `prependImport`: Prepends the import statement, if `programs.waybar.style` is a string (with default override priority).
|
||
|
- `createLink`: Creates a symbolic link `~/.config/waybar/rose-pine.css`, which needs to be included in the waybar stylesheet.
|
||
|
'';
|
||
|
};
|
||
|
};
|
||
|
|
||
|
config = lib.mkIf enable (
|
||
|
lib.mkMerge [
|
||
|
(lib.mkIf (cfg.mode == "prependImport") {
|
||
|
services.swaync.style = lib.mkBefore ''
|
||
|
@import "${styleFile}";
|
||
|
'';
|
||
|
})
|
||
|
(lib.mkIf (cfg.mode == "createLink") {
|
||
|
xdg.configFile."swaync/rose-pine.css".source = styleFile;
|
||
|
})
|
||
|
]
|
||
|
);
|
||
|
}
|