skim: Move shell completions to package (#444067)

Sandro f9be5a32 a28e9c99

Changed files
+24 -18
nixos
doc
manual
release-notes
modules
programs
pkgs
by-name
sk
+2
nixos/doc/manual/release-notes/rl-2511.section.md
···
- 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
nixos/modules/programs/skim.nix
···
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
pkgs/by-name/sk/skim/package.nix
···
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