From ec53d3f5aa01bf8c3d54d70177602f9fc08f1ecf Mon Sep 17 00:00:00 2001 From: Donovan Glover Date: Tue, 2 Jan 2024 18:07:51 -0500 Subject: [PATCH] packages: Add pnpm-shell-completion Not perfect but works for my use case. --- packages/default.nix | 1 + packages/pnpm-shell-completion.nix | 37 ++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 packages/pnpm-shell-completion.nix diff --git a/packages/default.nix b/packages/default.nix index e726650..79fac4b 100644 --- a/packages/default.nix +++ b/packages/default.nix @@ -10,6 +10,7 @@ environment.systemPackages = with pkgs; [ (callPackage ./osu-backgrounds.nix { }) (callPackage ./candy-icons.nix { }) + (callPackage ./pnpm-shell-completion.nix { }) (callPackage ./webp-thumbnailer.nix { }) ]; } diff --git a/packages/pnpm-shell-completion.nix b/packages/pnpm-shell-completion.nix new file mode 100644 index 0000000..ce4850c --- /dev/null +++ b/packages/pnpm-shell-completion.nix @@ -0,0 +1,37 @@ +{ rustPlatform +, fetchFromGitHub +, lib +, installShellFiles +}: + +rustPlatform.buildRustPackage rec { + pname = "pnpm-shell-completion"; + version = "0.5.2"; + + src = fetchFromGitHub { + owner = "g-plane"; + repo = "pnpm-shell-completion"; + rev = "v${version}"; + hash = "sha256-VCIT1HobLXWRe3yK2F3NPIuWkyCgckytLPi6yQEsSIE="; + }; + + cargoHash = "sha256-SzB5hwh7rIxKM3O9ffQzrzCwbwqPQ+QZP7Pb5PNVqmE="; + + nativeBuildInputs = [ + installShellFiles + ]; + + postInstall = /* bash */ '' + installShellCompletion --cmd pnpm \ + --fish pnpm-shell-completion.fish \ + --zsh pnpm-shell-completion.plugin.zsh + ''; + + meta = with lib; { + homepage = "https://github.com/g-plane/pnpm-shell-completion"; + description = "Complete your pnpm command fastly"; + license = licenses.mit; + maintainers = with maintainers; [ donovanglover ]; + mainProgram = "pnpm-shell-completion"; + }; +}