1 { pkgs, config, lib, ... }:
4 cfg = config.programs.fzf;
9 fuzzyCompletion = lib.mkEnableOption "fuzzy completion with fzf";
10 keybindings = lib.mkEnableOption "fzf keybindings";
14 config = lib.mkIf (cfg.keybindings || cfg.fuzzyCompletion) {
15 environment.systemPackages = lib.mkIf (cfg.keybindings || cfg.fuzzyCompletion) [ pkgs.fzf ];
18 # load after programs.bash.completion.enable
19 bash.promptPluginInit = lib.mkAfter (lib.optionalString cfg.fuzzyCompletion ''
20 source ${pkgs.fzf}/share/fzf/completion.bash
21 '' + lib.optionalString cfg.keybindings ''
22 source ${pkgs.fzf}/share/fzf/key-bindings.bash
26 interactiveShellInit = lib.optionalString (!config.programs.zsh.ohMyZsh.enable)
27 (lib.optionalString cfg.fuzzyCompletion ''
28 source ${pkgs.fzf}/share/fzf/completion.zsh
29 '' + lib.optionalString cfg.keybindings ''
30 source ${pkgs.fzf}/share/fzf/key-bindings.zsh
33 ohMyZsh.plugins = lib.mkIf config.programs.zsh.ohMyZsh.enable [ "fzf" ];
38 meta.maintainers = with lib.maintainers; [ laalsaas ];