2023-11-02 08:55:47 -07:00
|
|
|
{ config
|
|
|
|
, pkgs
|
|
|
|
, lib
|
2023-11-02 10:55:47 -07:00
|
|
|
, sources
|
2023-11-02 08:55:47 -07:00
|
|
|
, ...
|
|
|
|
}:
|
|
|
|
let
|
|
|
|
inherit (builtins) readFile;
|
|
|
|
|
|
|
|
cfg = config.services.mako.catppuccin;
|
|
|
|
enable = cfg.enable && config.services.mako.enable;
|
2023-11-02 10:55:47 -07:00
|
|
|
theme = lib.ctp.fromINI (sources.mako + /src/${cfg.flavour});
|
2023-11-02 08:55:47 -07:00
|
|
|
|
|
|
|
# Settings that need to be extracted and put in extraConfig
|
|
|
|
extraConfigAttrs = lib.attrsets.getAttrs [ "urgency=high" ] theme;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.services.mako.catppuccin =
|
2023-11-02 10:55:47 -07:00
|
|
|
lib.ctp.mkCatppuccinOpt "mako";
|
2023-11-02 08:55:47 -07:00
|
|
|
|
|
|
|
# Will cause infinite recursion if config.services.mako is directly set as a whole
|
|
|
|
config.services.mako = lib.mkIf enable {
|
|
|
|
backgroundColor = theme.background-color;
|
|
|
|
textColor = theme.text-color;
|
|
|
|
borderColor = theme.border-color;
|
|
|
|
progressColor = theme.progress-color;
|
|
|
|
extraConfig = readFile ((pkgs.formats.ini { }).generate "mako-extra-config" extraConfigAttrs);
|
|
|
|
};
|
|
|
|
}
|