Skip to content

Commit

Permalink
tailscale: add shell completions
Browse files Browse the repository at this point in the history
  • Loading branch information
peterablehmann committed Jun 14, 2024
1 parent 2bc94ad commit 7c0b81b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkgs/servers/tailscale/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
, shadow
, procps
, nixosTests
, installShellFiles
}:

let
Expand Down Expand Up @@ -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;

Expand All @@ -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
'';
Expand Down

0 comments on commit 7c0b81b

Please sign in to comment.