diff options
-rw-r--r-- | ops/nixos/modules/tailscale.nix | 77 | ||||
-rw-r--r-- | third_party/tailscale/0001-fix-client-logger.patch | 28 | ||||
-rw-r--r-- | third_party/tailscale/default.nix | 41 |
3 files changed, 0 insertions, 146 deletions
diff --git a/ops/nixos/modules/tailscale.nix b/ops/nixos/modules/tailscale.nix deleted file mode 100644 index 8f08ec95bdfc..000000000000 --- a/ops/nixos/modules/tailscale.nix +++ /dev/null @@ -1,77 +0,0 @@ -# NixOS module for Tailscale -{ config, lib, pkgs, ... }: - -with lib; - -let - cfg = config.services.tailscale; - - aclVar = optionalAttrs (cfg.aclFile != null) { - ACL_FILE = "--acl-file=${cfg.aclFile}"; - }; - -in { - options.services.tailscale = { - enable = mkEnableOption "Tailscale relay"; - - package = mkOption { - type = types.package; - default = pkgs.tailscale; # <- this doesn't actually exist yet - description = "Tailscale client package to use"; - }; - - port = mkOption { - type = types.int; - default = 41641; - description = '' - Set the port to listen on for incoming VPN packets. - - Remote nodes will automatically be informed about the new port - number, but you might want to configure this in order to set - external firewall settings. - ''; - }; - - aclFile = mkOption { - type = with types; nullOr path; - default = "${cfg.package}/etc/acl.json"; - }; - - relayConf = mkOption { - type = types.path; - example = "/etc/tailscale.conf"; - description = "The path to relay.conf"; - }; - - extraFlags = mkOption { - type = with types; listOf str; - default = []; - description = "Extra flags you might want to pass to relaynode."; - }; - }; - - config = mkIf cfg.enable { - environment.systemPackages = [ cfg.package ]; - - systemd.services.tailscale-relay = { - description = "Traffic relay node for Tailscale IPN"; - after = [ "network.target" ]; - wantedBy = [ "multi-user.target" ]; - path = with pkgs; [ iproute iptables ]; - - unitConfig.ConditionPathExists = cfg.relayConf; - - script = concatStringsSep " " ([ - "${cfg.package}/bin/relaynode" - "--port=${toString cfg.port}" - "--config=${cfg.relayConf}" - (optionalString (cfg.aclFile != null) "--acl-file=${cfg.aclFile}") - ] ++ cfg.extraFlags); - - serviceConfig = { - RuntimeDirectory = "tailscale"; - LogsDirectory = "tailscale"; - }; - }; - }; -} diff --git a/third_party/tailscale/0001-fix-client-logger.patch b/third_party/tailscale/0001-fix-client-logger.patch deleted file mode 100644 index d86694adcae7..000000000000 --- a/third_party/tailscale/0001-fix-client-logger.patch +++ /dev/null @@ -1,28 +0,0 @@ -From ce33360524307b6da4f996a9f465260e121011f8 Mon Sep 17 00:00:00 2001 -From: Vincent Ambo <tazjin@google.com> -Date: Tue, 11 Feb 2020 00:40:37 +0000 -Subject: [PATCH] fix(control): Ensure control client has a logger function - -For some reason this field ended up being nil in taillogin, which made -it difficult to actually log in. ---- - control/controlclient/auto.go | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/control/controlclient/auto.go b/control/controlclient/auto.go -index 67f187f..09cdf6f 100644 ---- a/control/controlclient/auto.go -+++ b/control/controlclient/auto.go -@@ -160,6 +160,9 @@ func NewNoStart(opts Options) (*Client, error) { - // - // It should only be called for clients created by NewNoStart. - func (c *Client) Start() { -+ c.logf = func(f string, args ...interface{}) { -+ fmt.Printf(f, args) -+ } - go c.authRoutine() - go c.mapRoutine() - } --- -2.23.0 - diff --git a/third_party/tailscale/default.nix b/third_party/tailscale/default.nix deleted file mode 100644 index 9f26d8f76af6..000000000000 --- a/third_party/tailscale/default.nix +++ /dev/null @@ -1,41 +0,0 @@ -# This file packages the Tailscale client using the standard upstream -# Go packaging mechanisms instead of buildGo.nix - -{ pkgs, lib, ... }: - -let - inherit (pkgs) buildGoModule fetchFromGitHub; -in buildGoModule rec { - pname = "tailscale"; - version = "fef25489"; - - src = fetchFromGitHub { - owner = "tailscale"; - repo = "tailscale"; - rev = "fef254898178d100f25b98530499adcf07cfded3"; - sha256 = "1islxzr8lhnl2f0r686mcciwb8lzvqjczg9fs0nagr5pp6dsi9fa"; - }; - - patches = [ ./0001-fix-client-logger.patch ]; - - goPackagePath = "tailscale.com"; - modSha256 = "0cnih9flwgqjq4x4cwyac9yyz1prv2i2by1ki3g71ai8q621bq10"; - subPackages = [ - "cmd/relaynode" - "cmd/taillogin" - "cmd/tailscale" - "cmd/tailscaled" - ]; - - postInstall = '' - mkdir -p $out/etc/ - cp ${src}/cmd/relaynode/acl.json $out/etc/ - ''; - - meta = with lib; { - homepage = "https://tailscale.com/"; - description = "Private WireGuard networks made easy"; - license = licenses.bsd3; - maintainers = with maintainers; [ tazjin ]; - }; -} |