2024-01-25 14:12:00 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, makeWrapper
|
|
|
|
, getent
|
|
|
|
, iproute2
|
|
|
|
, iptables
|
|
|
|
, shadow
|
|
|
|
, procps
|
|
|
|
, nixosTests
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
let
|
2024-02-29 20:09:43 +00:00
|
|
|
version = "1.60.0";
|
2023-07-15 17:15:38 +00:00
|
|
|
in
|
|
|
|
buildGoModule {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "tailscale";
|
2023-07-15 17:15:38 +00:00
|
|
|
inherit version;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "tailscale";
|
|
|
|
repo = "tailscale";
|
2020-08-20 17:08:02 +00:00
|
|
|
rev = "v${version}";
|
2024-02-29 20:09:43 +00:00
|
|
|
hash = "sha256-qx6ukgaEsdsq76E+GQkYH/Ydv3VKO9jLTh1zm0pGeWw=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2024-02-29 20:09:43 +00:00
|
|
|
vendorHash = "sha256-eci4f6golU1eIQOezplA+I+gmOfof40ktIdpr0v/uMc=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-10-01 09:20:50 +00:00
|
|
|
nativeBuildInputs = lib.optionals stdenv.isLinux [ makeWrapper ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
CGO_ENABLED = 0;
|
|
|
|
|
|
|
|
subPackages = [ "cmd/tailscale" "cmd/tailscaled" ];
|
|
|
|
|
2023-03-24 00:07:29 +00:00
|
|
|
ldflags = [
|
|
|
|
"-w"
|
|
|
|
"-s"
|
|
|
|
"-X tailscale.com/version.longStamp=${version}"
|
|
|
|
"-X tailscale.com/version.shortStamp=${version}"
|
|
|
|
];
|
2020-10-27 00:29:36 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
doCheck = false;
|
|
|
|
|
2021-10-01 09:20:50 +00:00
|
|
|
postInstall = lib.optionalString stdenv.isLinux ''
|
2022-07-14 12:49:19 +00:00
|
|
|
wrapProgram $out/bin/tailscaled --prefix PATH : ${lib.makeBinPath [ iproute2 iptables getent shadow ]}
|
2021-08-10 14:31:46 +00:00
|
|
|
wrapProgram $out/bin/tailscale --suffix PATH : ${lib.makeBinPath [ procps ]}
|
|
|
|
|
2020-11-06 00:33:48 +00:00
|
|
|
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
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2024-01-25 14:12:00 +00:00
|
|
|
passthru.tests = {
|
|
|
|
inherit (nixosTests) headscale;
|
|
|
|
};
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://tailscale.com";
|
|
|
|
description = "The node agent for Tailscale, a mesh VPN built on WireGuard";
|
|
|
|
license = licenses.bsd3;
|
2023-08-22 20:05:09 +00:00
|
|
|
mainProgram = "tailscale";
|
2023-10-09 19:29:22 +00:00
|
|
|
maintainers = with maintainers; [ danderson mbaillie twitchyliquid64 jk mfrw ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2020-06-18 07:06:33 +00:00
|
|
|
}
|