2024-05-21 14:53:46 -07:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
...
|
2023-11-03 09:07:31 -07:00
|
|
|
}:
|
|
|
|
let
|
2024-05-13 13:33:16 -07:00
|
|
|
inherit (config.catppuccin) sources;
|
2023-11-03 09:07:31 -07:00
|
|
|
cfg = config.programs.zathura.catppuccin;
|
|
|
|
enable = cfg.enable && config.programs.zathura.enable;
|
|
|
|
themeFile = sources.zathura + /src/catppuccin-${cfg.flavour};
|
|
|
|
in
|
|
|
|
{
|
2024-05-21 14:53:46 -07:00
|
|
|
options.programs.zathura.catppuccin = lib.ctp.mkCatppuccinOpt "zathura";
|
2023-11-03 09:07:31 -07:00
|
|
|
|
2024-05-21 14:53:46 -07:00
|
|
|
config.programs.zathura.options = lib.mkIf enable (
|
|
|
|
lib.ctp.fromINI (
|
|
|
|
pkgs.runCommand "catppuccin-zathura-theme" { } ''
|
2023-11-03 09:07:31 -07:00
|
|
|
${pkgs.gawk}/bin/awk '/.+/ { printf "%s=%s\n", $2, $3 }' ${themeFile} > $out
|
2024-05-21 14:53:46 -07:00
|
|
|
''
|
|
|
|
)
|
|
|
|
);
|
2023-11-03 09:07:31 -07:00
|
|
|
}
|