nixpkgs/nixos/modules/programs/fzf.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

47 lines
1.4 KiB
Nix
Raw Normal View History

2023-04-08 22:59:58 +02:00
{ pkgs, config, lib, ... }:
2022-11-11 21:08:36 +01:00
with lib;
2022-11-11 21:08:36 +01:00
let
cfg = config.programs.fzf;
2023-04-08 22:59:58 +02:00
in
{
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.
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.
If you want to change/disable certain keybindings please check the fzf-documentation.
'')
];
2022-11-11 21:08:36 +01:00
options = {
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
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
'';
programs.zsh = {
interactiveShellInit = optionalString (!config.programs.zsh.ohMyZsh.enable) ''
eval "$(${getExe pkgs.fzf} --zsh)"
'';
2023-04-08 22:59:58 +02:00
ohMyZsh.plugins = mkIf (config.programs.zsh.ohMyZsh.enable) [ "fzf" ];
};
2022-11-11 21:08:36 +01:00
};
2022-11-11 21:08:36 +01:00
meta.maintainers = with maintainers; [ laalsaas ];
}