From 2fcba75c19b9bae8f99b9d9eca43243571a8bf33 Mon Sep 17 00:00:00 2001 From: kilianar Date: Thu, 17 Nov 2022 14:11:00 +0100 Subject: [PATCH] onefetch: install shell completions --- pkgs/tools/misc/onefetch/default.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/misc/onefetch/default.nix b/pkgs/tools/misc/onefetch/default.nix index 1792dd588f0e..d4cc9f08f1ac 100644 --- a/pkgs/tools/misc/onefetch/default.nix +++ b/pkgs/tools/misc/onefetch/default.nix @@ -9,6 +9,7 @@ , libresolv , Security , git +, installShellFiles }: rustPlatform.buildRustPackage rec { @@ -29,7 +30,7 @@ rustPlatform.buildRustPackage rec { ./zstd-pkg-config.patch ]; - nativeBuildInputs = [ cmake pkg-config ]; + nativeBuildInputs = [ cmake installShellFiles pkg-config ]; buildInputs = [ zstd ] ++ lib.optionals stdenv.isDarwin [ CoreFoundation libresolv Security ]; @@ -45,6 +46,13 @@ rustPlatform.buildRustPackage rec { git commit -m test ''; + postInstall = '' + installShellCompletion --cmd onefetch \ + --bash <($out/bin/onefetch --generate bash) \ + --fish <($out/bin/onefetch --generate fish) \ + --zsh <($out/bin/onefetch --generate zsh) + ''; + meta = with lib; { description = "Git repository summary on your terminal"; homepage = "https://github.com/o2sh/onefetch";