Unverified Commit 09c1e6c1 authored by lenny's avatar lenny
Browse files

skim: Move shell completions to package

This also adds the previously missing fish completions
parent 32de7cfc
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -166,6 +166,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
Original line number Diff line number Diff line
@@ -8,36 +8,35 @@ 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 ''
    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 ''
    programs.zsh.interactiveShellInit = optionalString cfg.keybindings ''
      source ${cfg.package}/share/skim/key-bindings.zsh
    '';

+5 −0
Original line number Diff line number Diff line
@@ -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