skim: Move shell completions to package (#444067)

This commit is contained in:
Sandro
2025-09-23 19:07:51 +00:00
committed by GitHub
3 changed files with 24 additions and 18 deletions
@@ -168,6 +168,8 @@
- The default `kops` version is now 1.33.0 and versions 1.30 and older have been dropped. See [Upgrading Kubernetes](https://kops.sigs.k8s.io/tutorial/upgrading-kubernetes/) for instructions on how to update kOps.
- `programs.skim.fuzzyCompletions` has been removed in favor of adding the completions to the package itself.
- `Prosody` has been updated to major release 13 which removed some obsoleted modules and brought a couple of major and breaking changes:
- The `http_files` module is now disabled by default because it now requires `http_files_dir` to be configured.
- The `vcard_muc` module has been removed and got replaced by the inbuilt `muc_vcard` module.
+17 -18
View File
@@ -8,38 +8,37 @@ let
inherit (lib)
mkEnableOption
mkPackageOption
optional
mkRemovedOptionModule
optionalString
mkIf
;
cfg = config.programs.skim;
in
{
imports = [
(mkRemovedOptionModule [ "programs" "skim" "fuzzyCompletion" ]
"programs.skim.fuzzyCompletion has been removed. Completions are now included in the package itself."
)
];
options = {
programs.skim = {
fuzzyCompletion = mkEnableOption "fuzzy completion with skim";
enable = mkEnableOption "skim fuzzy finder";
keybindings = mkEnableOption "skim keybindings";
package = mkPackageOption pkgs "skim" { };
};
};
config = {
environment.systemPackages = optional (cfg.keybindings || cfg.fuzzyCompletion) cfg.package;
config = mkIf cfg.enable {
environment.systemPackages = [ 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.bash.interactiveShellInit = 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
'';
programs.zsh.interactiveShellInit = optionalString cfg.keybindings ''
source ${cfg.package}/share/skim/key-bindings.zsh
'';
programs.fish.interactiveShellInit = optionalString cfg.keybindings ''
source ${cfg.package}/share/skim/key-bindings.fish && skim_key_bindings
+5
View File
@@ -51,6 +51,11 @@ rustPlatform.buildRustPackage rec {
installBin sk-share
installManPage $(find man -type f)
installShellCompletion \
--cmd sk \
--bash shell/completion.bash \
--fish shell/completion.fish \
--zsh shell/completion.zsh
'';
# Doc tests are broken on aarch64