Skip to content

Commit

Permalink
fix(home-manager/zathura): avoid IFD
Browse files Browse the repository at this point in the history
  • Loading branch information
Anomalocaridid committed Jul 29, 2024
1 parent 8bdb55c commit 762fb57
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions modules/home-manager/zathura.nix
Original file line number Diff line number Diff line change
@@ -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}"}
'';
}

0 comments on commit 762fb57

Please sign in to comment.