diff options
Diffstat (limited to 'modules/terminal/fzf')
| -rw-r--r-- | modules/terminal/fzf/default.nix | 75 |
1 files changed, 37 insertions, 38 deletions
diff --git a/modules/terminal/fzf/default.nix b/modules/terminal/fzf/default.nix index a7cc2f5..080e6a2 100644 --- a/modules/terminal/fzf/default.nix +++ b/modules/terminal/fzf/default.nix @@ -6,7 +6,12 @@ ... }: let + cfg = config.terminal.fzf; base16Colors = import ../../colors/base16 { inherit config lib pkgs; }; + + shellIntegration = '' + ${if config.terminal.zsh.enable then "eval \"$(fzf --zsh)\"" else "eval \"$(fzf --bash)\""} + ''; in { imports = [ ./assertions.nix ]; @@ -21,48 +26,42 @@ in }; }; - config = - let - shellIntegration = '' - ${if config.terminal.zsh.enable then "eval \"$(fzf --zsh)\"" else "eval \"$(fzf --bash)\""} - ''; - in - lib.mkIf config.terminal.fzf.enable { - programs.fzf = { - enable = true; - defaultOptions = [ - "--height 100%" - "--layout=reverse" - "--pointer=' '" - "--header=' '" - "--prompt=' '" - "--marker='✓ '" - "--border=none" - "--cycle" - "--no-info" - "--margin='1,2'" - ]; + config = lib.mkIf cfg.enable { + programs.fzf = { + enable = true; + defaultOptions = [ + "--height 100%" + "--layout=reverse" + "--pointer=' '" + "--header=' '" + "--prompt=' '" + "--marker='✓ '" + "--border=none" + "--cycle" + "--no-info" + "--margin='1,2'" + ]; - colors = with base16Colors.colorsWithHashPrefix; { - fg = base05; - bg = "-1"; - hl = base0D; + colors = with base16Colors.colorsWithHashPrefix; { + fg = base05; + bg = "-1"; + hl = base0D; - "fg+" = base07; - "bg+" = "-1"; - "hl+" = base0D; + "fg+" = base07; + "bg+" = "-1"; + "hl+" = base0D; - gutter = "-1"; + gutter = "-1"; - info = base0B; - border = base03; - prompt = base0A; - pointer = base0F; - marker = base0C; - spinner = base0C; - }; + info = base0B; + border = base03; + prompt = base0A; + pointer = base0F; + marker = base0C; + spinner = base0C; }; - - programs.zsh.initContent = lib.mkIf config.terminal.zsh.enable (lib.mkAfter shellIntegration); }; + + programs.zsh.initContent = lib.mkIf config.terminal.zsh.enable (lib.mkAfter shellIntegration); + }; } |
