fix(home-manager/zathura): avoid IFD (#298)

This commit is contained in:
Anomalocaridid 2024-08-06 21:35:24 -04:00 committed by GitHub
parent 7e23de352f
commit 41d51d7f04
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,23 +1,13 @@
{
config,
pkgs,
lib,
...
}:
{ config, 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
{
options.programs.zathura.catppuccin = lib.ctp.mkCatppuccinOpt { name = "zathura"; };
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
''
)
);
config.programs.zathura.extraConfig = lib.mkIf enable ''
include ${sources.zathura + "/src/catppuccin-${cfg.flavor}"}
'';
}