From f8398339a3d45dd8509c0f3fb5bd1403ea560d71 Mon Sep 17 00:00:00 2001 From: Gleb Peregud Date: Mon, 12 Mar 2018 23:29:46 +0100 Subject: [PATCH] fzf: add `enableZshIntegration` option When enabled this will extend user's `$HOME/.zshrc` with sourcing of fzf's completion and key-bindings integration libraries. --- modules/programs/fzf.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/modules/programs/fzf.nix b/modules/programs/fzf.nix index 7949f7f8..2085d9e5 100644 --- a/modules/programs/fzf.nix +++ b/modules/programs/fzf.nix @@ -55,6 +55,14 @@ in Whether to enable Bash integration. ''; }; + + enableZshIntegration = mkOption { + default = true; + type = types.bool; + description = '' + Whether to enable Zsh integration. + ''; + }; }; config = mkIf cfg.enable { @@ -74,5 +82,10 @@ in . ${pkgs.fzf}/share/fzf/completion.bash . ${pkgs.fzf}/share/fzf/key-bindings.bash ''; + + programs.zsh.initExtra = mkIf cfg.enableZshIntegration '' + . ${pkgs.fzf}/share/fzf/completion.zsh + . ${pkgs.fzf}/share/fzf/key-bindings.zsh + ''; }; }