diff options
author | laalsaas <laalsaas@systemli.org> | 2022-12-03 19:12:04 +0100 |
---|---|---|
committer | laalsaas <laalsaas@systemli.org> | 2022-12-03 23:15:09 +0100 |
commit | a78621f9b02cb5a1a0d671b9f721349a9ad0e558 (patch) | |
tree | c2020c919fd7df09b5e813f084e322ca24867f05 /nixos/modules/programs | |
parent | 2a7fae33a433147cc9c78dbd33702fa9ad7c4ad0 (diff) |
skim: init module
Diffstat (limited to 'nixos/modules/programs')
-rw-r--r-- | nixos/modules/programs/skim.nix | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/nixos/modules/programs/skim.nix b/nixos/modules/programs/skim.nix new file mode 100644 index 0000000000000..1333cdd30ab23 --- /dev/null +++ b/nixos/modules/programs/skim.nix @@ -0,0 +1,30 @@ +{ pkgs, config, lib, ... }: +let + inherit (lib) mdDoc mkEnableOption mkPackageOption optional optionalString; + cfg = config.programs.skim; +in +{ + options = { + programs.skim = { + fuzzyCompletion = mkEnableOption (mdDoc "fuzzy Completion with skim"); + keybindings = mkEnableOption (mdDoc "skim keybindings"); + package = mkPackageOption pkgs "skim" {}; + }; + }; + + config = { + environment.systemPackages = optional (cfg.keybindings || cfg.fuzzyCompletion) cfg.package; + + programs.bash.interactiveShellInit = optionalString cfg.fuzzyCompletion '' + source ${cfg.package}/share/skim/completion.bash + '' + optionalString cfg.keybindings '' + source ${cfg.package}/share/skim/key-bindings.bash + ''; + + programs.zsh.interactiveShellInit = optionalString cfg.fuzzyCompletion '' + source ${cfg.package}/share/skim/completion.zsh + '' + optionalString cfg.keybindings '' + source ${cfg.package}/share/skim/key-bindings.zsh + ''; + }; +} |