From 097a72ab17272063772f88441c902511f36bd188 Mon Sep 17 00:00:00 2001 From: winston Date: Sun, 5 Nov 2023 14:30:05 +0100 Subject: [PATCH] build(nix): add shell completions (#89) --- flake.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 3b29f83..39937c1 100644 --- a/flake.nix +++ b/flake.nix @@ -16,11 +16,19 @@ }); packages = forAllSystems (pkgs: rec { - mdbook-catppuccin = pkgs.rustPlatform.buildRustPackage { + mdbook-catppuccin = pkgs.rustPlatform.buildRustPackage rec { pname = "mdbook-catppuccin"; inherit version; src = pkgs.nix-gitignore.gitignoreSource [] ./.; cargoLock.lockFile = ./Cargo.lock; + + nativeBuildInputs = with pkgs; [installShellFiles]; + postInstall = '' + installShellCompletion --cmd ${pname} \ + --bash <($out/bin/${pname} completion bash) \ + --fish <($out/bin/${pname} completion fish) \ + --zsh <($out/bin/${pname} completion zsh) + ''; }; default = mdbook-catppuccin; });