rose-pine-nix/modules/home-manager/zathura.nix

24 lines
565 B
Nix
Raw Normal View History

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