1 { pkgs, config, lib, ... }:
3 inherit (lib) mkEnableOption mkPackageOption optional optionalString;
4 cfg = config.programs.skim;
9 fuzzyCompletion = mkEnableOption "fuzzy completion with skim";
10 keybindings = mkEnableOption "skim keybindings";
11 package = mkPackageOption pkgs "skim" {};
16 environment.systemPackages = optional (cfg.keybindings || cfg.fuzzyCompletion) cfg.package;
18 programs.bash.interactiveShellInit = optionalString cfg.fuzzyCompletion ''
19 source ${cfg.package}/share/skim/completion.bash
20 '' + optionalString cfg.keybindings ''
21 source ${cfg.package}/share/skim/key-bindings.bash
24 programs.zsh.interactiveShellInit = optionalString cfg.fuzzyCompletion ''
25 source ${cfg.package}/share/skim/completion.zsh
26 '' + optionalString cfg.keybindings ''
27 source ${cfg.package}/share/skim/key-bindings.zsh
30 programs.fish.interactiveShellInit = optionalString cfg.keybindings ''
31 source ${cfg.package}/share/skim/key-bindings.fish && skim_key_bindings