rose-pine-nix/modules/home-manager/mako.nix
seth 28e6d8a18d
feat(modules): add catppuccin.sources option (#129)
* feat(modules): add `catppuccin.sources` option

* refactor(modules)!: nvfetcher -> npins

npins gives us a nicer file to import that is a simple name value pair
of the port and the path in the store. this allows for easier overriding
with the catppuccin.sources option

* fix(modules): ensure default sources are applied to `catppuccin.sources`
2024-05-13 16:33:16 -04:00

27 lines
847 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 + /src/${cfg.flavour});
# 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 "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);
};
}