grafana-alloy: install shell completions

This commit is contained in:
Florian Klink
2024-06-06 22:13:32 +03:00
parent c590fba573
commit 255eb15db3
+9 -1
View File
@@ -9,6 +9,7 @@
, nodejs
, grafana-alloy
, nix-update-script
, installShellFiles
, testers
}:
@@ -26,7 +27,7 @@ buildGoModule rec {
proxyVendor = true;
vendorHash = "sha256-6Xc2siImM1Dl716uGhtAGcn+PO2OLuYLxanzg8Ho6SA=";
nativeBuildInputs = [ fixup-yarn-lock yarn nodejs ];
nativeBuildInputs = [ fixup-yarn-lock yarn nodejs installShellFiles ];
ldflags =
let
@@ -93,6 +94,13 @@ buildGoModule rec {
$out/bin/alloy
'';
postInstall = ''
installShellCompletion --cmd alloy \
--bash <($out/bin/alloy completion bash) \
--fish <($out/bin/alloy completion fish) \
--zsh <($out/bin/alloy completion zsh)
'';
passthru = {
tests = {
version = testers.testVersion {