-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fzf: Update package and module (shell-completions)
Update derivation to not install old shell-completions Update module to load completion for bash, fish (new) and zsh (or oh-my-zsh plugin) with changed way through fzf-binary Added change to release note as it is backwards-incompatible.
- Loading branch information
Showing
4 changed files
with
34 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,46 @@ | ||
{ pkgs, config, lib, ... }: | ||
|
||
with lib; | ||
|
||
let | ||
cfg = config.programs.fzf; | ||
|
||
in | ||
{ | ||
imports = [ | ||
(lib.mkRemovedOptionModule [ "programs" "fzf" "keybindings" ] '' | ||
Use "programs.fzf.enabled" instead, due to fzf upstream-change it's not possible to load shell-completion and keybindings seperatly. | ||
If you want to change/disable certain keybindings please check the fzf-documentation. | ||
'') | ||
(lib.mkRemovedOptionModule [ "programs" "fzf" "fuzzyCompletion" ] '' | ||
Use "programs.fzf.enabled" instead, due to fzf upstream-change it's not possible to load shell-completion and keybindings seperatly. | ||
If you want to change/disable certain keybindings please check the fzf-documentation. | ||
'') | ||
]; | ||
|
||
options = { | ||
programs.fzf = { | ||
fuzzyCompletion = mkEnableOption (mdDoc "fuzzy completion with fzf"); | ||
keybindings = mkEnableOption (mdDoc "fzf keybindings"); | ||
}; | ||
programs.fzf.enable = mkEnableOption (mdDoc "fuzzy completion with fzf and keybindings"); | ||
}; | ||
config = { | ||
environment.systemPackages = optional (cfg.keybindings || cfg.fuzzyCompletion) pkgs.fzf; | ||
|
||
programs.bash.interactiveShellInit = optionalString cfg.fuzzyCompletion '' | ||
source ${pkgs.fzf}/share/fzf/completion.bash | ||
'' + optionalString cfg.keybindings '' | ||
source ${pkgs.fzf}/share/fzf/key-bindings.bash | ||
config = mkIf cfg.enable { | ||
environment.systemPackages = [ pkgs.fzf ]; | ||
|
||
programs.bash.interactiveShellInit = '' | ||
eval "$(${getExe pkgs.fzf} --bash)" | ||
''; | ||
|
||
programs.fish.interactiveShellInit = '' | ||
eval "$(${getExe pkgs.fzf} --fish)" | ||
''; | ||
|
||
programs.zsh.interactiveShellInit = optionalString (!config.programs.zsh.ohMyZsh.enable) | ||
(optionalString cfg.fuzzyCompletion '' | ||
source ${pkgs.fzf}/share/fzf/completion.zsh | ||
'' + optionalString cfg.keybindings '' | ||
source ${pkgs.fzf}/share/fzf/key-bindings.zsh | ||
''); | ||
programs.zsh = { | ||
interactiveShellInit = optionalString (!config.programs.zsh.ohMyZsh.enable) '' | ||
eval "$(${getExe pkgs.fzf} --zsh)" | ||
''; | ||
|
||
programs.zsh.ohMyZsh.plugins = lib.mkIf (cfg.keybindings || cfg.fuzzyCompletion) [ "fzf" ]; | ||
ohMyZsh.plugins = mkIf (config.programs.zsh.ohMyZsh.enable) [ "fzf" ]; | ||
}; | ||
}; | ||
|
||
meta.maintainers = with maintainers; [ laalsaas ]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters