43 lines
1.2 KiB
Nix
43 lines
1.2 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
...
|
|
}:
|
|
let
|
|
inherit (config.rose-pine) sources;
|
|
|
|
cfg = config.programs.waybar.rose-pine;
|
|
enable = cfg.enable && config.programs.waybar.enable;
|
|
|
|
styleFile = "${sources.waybar}/${lib.rp.getKebabTheme cfg.flavor}.css";
|
|
in
|
|
{
|
|
options.programs.waybar.rose-pine = lib.rp.mkRosePineOpt { name = "waybar"; } // {
|
|
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") {
|
|
programs.waybar.style = lib.mkBefore ''
|
|
@import "${styleFile}";
|
|
'';
|
|
})
|
|
(lib.mkIf (cfg.mode == "createLink") {
|
|
xdg.configFile."waybar/rose-pine.css".source = styleFile;
|
|
})
|
|
]
|
|
);
|
|
}
|