nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at python-updates 81 lines 2.4 kB view raw
1{ 2 lib, 3 buildGoModule, 4 fetchFromGitHub, 5 installShellFiles, 6 iana-etc, 7 libredirect, 8 nixosTests, 9 postgresql, 10 stdenv, 11}: 12buildGoModule rec { 13 pname = "headscale"; 14 version = "0.27.1"; 15 16 src = fetchFromGitHub { 17 owner = "juanfont"; 18 repo = "headscale"; 19 tag = "v${version}"; 20 hash = "sha256-eMqGJL+dxBThtW+0uMvnP5n2gk2kwOao6SukA38OMOE="; 21 }; 22 23 postPatch = '' 24 substituteInPlace hscontrol/types/version.go \ 25 --replace-fail 'Version: "dev"' 'Version: "${version}"' \ 26 --replace-fail 'Commit: "unknown"' 'Commit: "${src.tag}"' 27 ''; 28 29 vendorHash = "sha256-VOi4PGZ8I+2MiwtzxpKc/4smsL5KcH/pHVkjJfAFPJ0="; 30 31 subPackages = [ "cmd/headscale" ]; 32 33 nativeBuildInputs = [ installShellFiles ]; 34 35 nativeCheckInputs = [ 36 libredirect.hook 37 postgresql 38 ]; 39 40 checkFlags = [ "-short" ]; 41 42 preCheck = lib.optionalString stdenv.hostPlatform.isDarwin '' 43 export NIX_REDIRECTS=/etc/protocols=${iana-etc}/etc/protocols:/etc/services=${iana-etc}/etc/services 44 ''; 45 46 postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' 47 installShellCompletion --cmd headscale \ 48 --bash <($out/bin/headscale completion bash) \ 49 --fish <($out/bin/headscale completion fish) \ 50 --zsh <($out/bin/headscale completion zsh) 51 ''; 52 53 passthru.tests = { inherit (nixosTests) headscale; }; 54 55 meta = { 56 homepage = "https://github.com/juanfont/headscale"; 57 description = "Open source, self-hosted implementation of the Tailscale control server"; 58 longDescription = '' 59 Tailscale is a modern VPN built on top of Wireguard. It works like an 60 overlay network between the computers of your networks - using all kinds 61 of NAT traversal sorcery. 62 63 Everything in Tailscale is Open Source, except the GUI clients for 64 proprietary OS (Windows and macOS/iOS), and the 65 'coordination/control server'. 66 67 The control server works as an exchange point of Wireguard public keys for 68 the nodes in the Tailscale network. It also assigns the IP addresses of 69 the clients, creates the boundaries between each user, enables sharing 70 machines between users, and exposes the advertised routes of your nodes. 71 72 Headscale implements this coordination server. 73 ''; 74 license = lib.licenses.bsd3; 75 mainProgram = "headscale"; 76 maintainers = with lib.maintainers; [ 77 kradalby 78 misterio77 79 ]; 80 }; 81}