Merge pull request #319894 from peterablehmann/tailscale
tailscale: add shell completions
This commit is contained in:
commit
ca3274ea13
@ -10,6 +10,7 @@
|
||||
, shadow
|
||||
, procps
|
||||
, nixosTests
|
||||
, installShellFiles
|
||||
}:
|
||||
|
||||
let
|
||||
@ -37,7 +38,7 @@ buildGoModule {
|
||||
|
||||
vendorHash = "sha256-SUjoeOFYz6zbEgv/vND7kEXbuWlZDrUKF2Dmqsf/KVw=";
|
||||
|
||||
nativeBuildInputs = lib.optionals stdenv.isLinux [ makeWrapper ];
|
||||
nativeBuildInputs = lib.optionals stdenv.isLinux [ makeWrapper ] ++ [ installShellFiles ];
|
||||
|
||||
CGO_ENABLED = 0;
|
||||
|
||||
@ -63,6 +64,12 @@ buildGoModule {
|
||||
--prefix PATH : ${lib.makeBinPath [ iproute2 iptables getent shadow ]} \
|
||||
--suffix PATH : ${lib.makeBinPath [ procps ]}
|
||||
|
||||
local INSTALL="$out/bin/tailscale"
|
||||
installShellCompletion --cmd tailscale \
|
||||
--bash <($out/bin/tailscale completion bash) \
|
||||
--fish <($out/bin/tailscale completion fish) \
|
||||
--zsh <($out/bin/tailscale completion zsh)
|
||||
|
||||
sed -i -e "s#/usr/sbin#$out/bin#" -e "/^EnvironmentFile/d" ./cmd/tailscaled/tailscaled.service
|
||||
install -D -m0444 -t $out/lib/systemd/system ./cmd/tailscaled/tailscaled.service
|
||||
'';
|
||||
|
Loading…
Reference in New Issue
Block a user