From b08e4805e37d37892e70218d70370bc84d4f27f4 Mon Sep 17 00:00:00 2001 From: Anomalocaridid <29845794+Anomalocaridid@users.noreply.github.com> Date: Wed, 10 Apr 2024 01:50:45 -0400 Subject: [PATCH] feat(home-manager): init fzf module (#93) --- modules/home-manager/fzf.nix | 35 +++++++++++++++++++++++++++++++++++ test.nix | 1 + 2 files changed, 36 insertions(+) create mode 100644 modules/home-manager/fzf.nix diff --git a/modules/home-manager/fzf.nix b/modules/home-manager/fzf.nix new file mode 100644 index 0000000..f61fd63 --- /dev/null +++ b/modules/home-manager/fzf.nix @@ -0,0 +1,35 @@ +{ config +, lib +, sources +, ... +}: +let + cfg = config.programs.fzf.catppuccin; + enable = cfg.enable && config.programs.fzf.enable; + palette = (lib.importJSON "${sources.palette}/palette.json").${cfg.flavour}.colors; +in +{ + options.programs.fzf.catppuccin = + lib.ctp.mkCatppuccinOpt "fzf"; + + config.programs.fzf.colors = lib.mkIf enable + # Manually populate with colors from catppuccin/fzf + # The ordering is meant to match the order of catppuccin/fzf to make comparison easier + (lib.attrsets.mapAttrs (_: color: palette.${color}.hex) + { + "bg+" = "surface0"; + bg = "base"; + spinner = "rosewater"; + hl = "red"; + fg = "text"; + header = "red"; + info = "mauve"; + pointer = "rosewater"; + marker = "rosewater"; + "fg+" = "text"; + prompt = "mauve"; + "hl+" = "red"; + } + ); +} + diff --git a/test.nix b/test.nix index bb34691..180c805 100644 --- a/test.nix +++ b/test.nix @@ -59,6 +59,7 @@ in bottom = ctpEnable; btop = ctpEnable; fish = ctpEnable; + fzf = ctpEnable; git.enable = true; # Required for delta git.delta = ctpEnable; gitui = ctpEnable;