about summary refs log tree commit diff
path: root/pkgs/servers/tailscale/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/servers/tailscale/default.nix')
-rw-r--r--pkgs/servers/tailscale/default.nix13
1 files changed, 10 insertions, 3 deletions
diff --git a/pkgs/servers/tailscale/default.nix b/pkgs/servers/tailscale/default.nix
index e5c9d4310cb82..a69e7eb3aecdd 100644
--- a/pkgs/servers/tailscale/default.nix
+++ b/pkgs/servers/tailscale/default.nix
@@ -10,10 +10,11 @@
 , shadow
 , procps
 , nixosTests
+, installShellFiles
 }:
 
 let
-  version = "1.68.0";
+  version = "1.68.1";
 in
 buildGoModule {
   pname = "tailscale";
@@ -23,7 +24,7 @@ buildGoModule {
     owner = "tailscale";
     repo = "tailscale";
     rev = "v${version}";
-    hash = "sha256-GTl5RCwIoDuzbaigy0/++xaPPEMLRDbBi/z82xCDOZY=";
+    hash = "sha256-ZAzro69F7ovfdqzRss/U7puh1T37bkEtUXabCYc5LwU=";
   };
 
   patches = [
@@ -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
   '';