rose-pine-nix/modules/home-manager/mako.nix
github-actions[bot] 3c3196c8c7
chore(modules): update ports (#307)
* chore(modules): update ports

Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix(home-manager/starship): use new config file path

* fix(home-manager/mako): use new theme path

---------

Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: getchoo <48872998+getchoo@users.noreply.github.com>
Co-authored-by: seth <getchoo@tuta.io>
2024-08-18 18:34:54 -04:00

29 lines
876 B
Nix

{
config,
pkgs,
lib,
...
}:
let
inherit (config.catppuccin) sources;
cfg = config.services.mako.catppuccin;
enable = cfg.enable && config.services.mako.enable;
theme = lib.ctp.fromINI (sources.mako + "/themes/${cfg.flavor}");
# Settings that need to be extracted and put in extraConfig
extraConfigAttrs = lib.attrsets.getAttrs [ "urgency=high" ] theme;
in
{
options.services.mako.catppuccin = lib.ctp.mkCatppuccinOpt { name = "mako"; };
# 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 = builtins.readFile (
(pkgs.formats.ini { }).generate "mako-extra-config" extraConfigAttrs
);
};
}