Skip to content

integrate tailscale #100

Open
Open

Description

@prusnak

for easy management

Activity

  1. bobberb commented on Oct 21, 2026

    @bobberb
    Collaborator

    What's your vision here @prusnak - we already have tailscale pretty well supported on nixos you want something it's probably an easy lift

  2. jaoleal commented on Oct 21, 2026

    @jaoleal

    +1 on @bobberb comment

  3. bobberb commented on Oct 21, 2026

    @bobberb
    Collaborator

    CLAUDE COMMENT:

    Plan: Tailscale preset

    WireGuard is already supported out of the box via modules/presets/wireguard.nix (nix-bitcoin-wg-connect QR helper, plus lndconnect-wg / lnconnect-clnrest-wg / lndconnect-clightning-wg). Tailscale would be a second preset in the same style, which gives a VPN "suite" of WireGuard + Tailscale/Headscale.

    1. modules/presets/tailscale.nix (new)

    • services.tailscale.enable = true, openFirewall = mkDefault true (UDP 41641, for direct connections instead of a relay).
    • Auth stays on the upstream options instead of being wrapped: services.tailscale.authKeyFile for unattended login, extraUpFlags = [ "--login-server=..." ] for Headscale, --ssh for Tailscale SSH (the "easy management" part).
    • REST exposure follows the same three conditions as the WireGuard preset (lnd lndconnect, clnrest lnconnect, clightning-rest lndconnect):
      • REST APIs bound to 0.0.0.0 with tor.enforce = false, same as WireGuard.
      • Ports opened only on the Tailscale interface via networking.firewall.interfaces.${services.tailscale.interfaceName}.allowedTCPPorts. This works with both the iptables and nftables backends, so the iptables-only assertion the WireGuard preset needs goes away. Spoofed sources on the LAN don't match an interface-pinned rule, and Tailscale ACLs take the place of restrictPeer.
    • Helpers lndconnect-ts, lnconnect-clnrest-ts, lndconnect-clightning-ts, which get the host at runtime from tailscale ip -4 and use --nocert.
    • Assertion: not compatible with netns-isolation, same as WireGuard.
    • Coexists with the WireGuard preset (both set the same 0.0.0.0 values).

    2. Test: test/tailscale-lndconnect.nix (new)

    • Three VMs, fully offline: control (Headscale), server (node with the preset, joined via authKeyFile + --login-server), client (plain Tailscale peer).
    • Subtests: both nodes join and ping over 100.x; each helper as operator reaches lnd / clnrest / clightning-rest /v1/getinfo over the tailnet; REST ports are closed on the plain LAN address; accept rules are pinned to tailscale0; the same checks hold under the nftables backend.
    • Registered in test/tests.nix, buildable in test/run-tests.sh, and the CI matrix in .github/workflows/test.yml, plus a tailscale-lndconnect-online dev scenario.

    3. Docs

    • docs/services.md: "Use Zeus via Tailscale (or Headscale)" section (import preset, auth key file, deploy, lndconnect-ts), Headscale and Tailscale SSH snippets, and a short WireGuard vs Tailscale comparison (no port forwarding, multi-device, third-party coordination server unless you self-host Headscale).
    • README.md: "via WireGuard, Tailscale or Tor".

    No versioning.nix entry, since the change only adds things.

    Open questions

    1. Expose the Electrum server (electrs/fulcrum) over Tailscale for Sparrow as an opt-in option (nix-bitcoin.tailscale.exposeElectrumServer, default off), or keep parity with WireGuard for now?
    2. Helper host: tailnet IP only, or also accept a MagicDNS name as an argument?
    3. Just Tailscale/Headscale, or also a generic VPN docs page with room for others (Nebula, ZeroTier)? I'd lean toward skipping that until someone asks.
  4. added
    area: modules
    type: feature
    on Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: modulestype: feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions