mirror of
https://github.com/CHN-beta/nixpkgs.git
synced 2026-01-12 02:40:31 +08:00
zizmor: add shell completions
Introduced in v1.7.0: https://github.com/zizmorcore/zizmor/blob/v1.7.0/docs/release-notes.md?plain=1#L60-L61
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
fetchFromGitHub,
|
||||
installShellFiles,
|
||||
nix-update-script,
|
||||
rustPlatform,
|
||||
versionCheckHook,
|
||||
@@ -20,6 +22,17 @@ rustPlatform.buildRustPackage (finalAttrs: {
|
||||
useFetchCargoVendor = true;
|
||||
cargoHash = "sha256-OVGaHLA/VzF8wGrWrHaKpYDcp4ZeR9mf2s5I+u5ddcs=";
|
||||
|
||||
nativeBuildInputs = lib.optionals (stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
|
||||
installShellFiles
|
||||
];
|
||||
|
||||
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
||||
installShellCompletion --cmd zizmor \
|
||||
--bash <("$out/bin/zizmor" --completions bash) \
|
||||
--zsh <("$out/bin/zizmor" --completions zsh) \
|
||||
--fish <("$out/bin/zizmor" --completions fish)
|
||||
'';
|
||||
|
||||
nativeInstallCheckInputs = [ versionCheckHook ];
|
||||
|
||||
doInstallCheck = true;
|
||||
|
||||
Reference in New Issue
Block a user