2023-04-08 22:59:58 +02:00
|
|
|
{ pkgs, config, lib, ... }:
|
2024-03-24 18:28:11 +01:00
|
|
|
|
2022-11-11 21:08:36 +01:00
|
|
|
with lib;
|
2024-03-24 18:28:11 +01:00
|
|
|
|
2022-11-11 21:08:36 +01:00
|
|
|
let
|
|
|
|
cfg = config.programs.fzf;
|
2024-03-24 18:28:11 +01:00
|
|
|
|
2023-04-08 22:59:58 +02:00
|
|
|
in
|
|
|
|
{
|
2024-03-24 18:28:11 +01:00
|
|
|
imports = [
|
|
|
|
(lib.mkRemovedOptionModule [ "programs" "fzf" "keybindings" ] ''
|
2024-04-10 13:55:33 +02:00
|
|
|
Use "programs.fzf.enable" instead, due to fzf upstream-change it's not possible to load shell-completion and keybindings separately.
|
2024-03-24 18:28:11 +01:00
|
|
|
If you want to change/disable certain keybindings please check the fzf-documentation.
|
|
|
|
'')
|
|
|
|
(lib.mkRemovedOptionModule [ "programs" "fzf" "fuzzyCompletion" ] ''
|
2024-04-10 13:55:33 +02:00
|
|
|
Use "programs.fzf.enable" instead, due to fzf upstream-change it's not possible to load shell-completion and keybindings separately.
|
2024-03-24 18:28:11 +01:00
|
|
|
If you want to change/disable certain keybindings please check the fzf-documentation.
|
|
|
|
'')
|
|
|
|
];
|
|
|
|
|
2022-11-11 21:08:36 +01:00
|
|
|
options = {
|
2024-03-24 18:28:11 +01:00
|
|
|
programs.fzf.enable = mkEnableOption (mdDoc "fuzzy completion with fzf and keybindings");
|
2022-11-11 21:08:36 +01:00
|
|
|
};
|
2023-04-08 22:59:58 +02:00
|
|
|
|
2024-03-24 18:28:11 +01:00
|
|
|
config = mkIf cfg.enable {
|
|
|
|
environment.systemPackages = [ pkgs.fzf ];
|
|
|
|
|
|
|
|
programs.bash.interactiveShellInit = ''
|
|
|
|
eval "$(${getExe pkgs.fzf} --bash)"
|
|
|
|
'';
|
|
|
|
|
|
|
|
programs.fish.interactiveShellInit = ''
|
2024-04-07 06:20:00 +02:00
|
|
|
${getExe pkgs.fzf} --fish | source
|
2022-11-11 21:08:36 +01:00
|
|
|
'';
|
|
|
|
|
2024-03-24 18:28:11 +01:00
|
|
|
programs.zsh = {
|
|
|
|
interactiveShellInit = optionalString (!config.programs.zsh.ohMyZsh.enable) ''
|
|
|
|
eval "$(${getExe pkgs.fzf} --zsh)"
|
|
|
|
'';
|
2023-04-08 22:59:58 +02:00
|
|
|
|
2024-03-24 18:28:11 +01:00
|
|
|
ohMyZsh.plugins = mkIf (config.programs.zsh.ohMyZsh.enable) [ "fzf" ];
|
|
|
|
};
|
2022-11-11 21:08:36 +01:00
|
|
|
};
|
2024-03-24 18:28:11 +01:00
|
|
|
|
2022-11-11 21:08:36 +01:00
|
|
|
meta.maintainers = with maintainers; [ laalsaas ];
|
|
|
|
}
|