Commit Graph

54 Commits

Author SHA1 Message Date
Scott Edlund
b67bf1607c nixos/tailscale: tailscaled-autoconnect use Type=notify, wait for Running
Previously the `Starting` state was missed, allowing the service to
complete before the interface was ready, causing services that bind to
Tailscale IPs to fail to start.

Now waits for Tailscale to report `Running` and notifies systemd
accordingly.

Switch the unit to Type=notify to timeout if there is no connection.

Remove `NeedsMachineAuth` gating since it requires client approval in
the console.
2025-09-15 17:55:41 +09:00
Philip Taron
78f76b6b33 nixos/tailscale: Add option to disable upstream debug logging (#432412) 2025-09-13 02:46:13 +00:00
dish
970dcca69c treewide: Fix links in module documentation 2025-08-25 12:55:11 -04:00
Dionysis Grigoropoulos
0bb6676d74 nixos/tailscale: Add option to disable upstream debug logging
Tailscale by default sends logs upstream to a centralized logging
service. We can disable this by adding an env var
https://tailscale.com/kb/1011/log-mesh-traffic?tab=linux#opting-out-of-client-logging
2025-08-10 05:19:04 +03:00
Wolfgang Walther
5a0711127c treewide: run nixfmt 1.0.0 2025-07-24 13:55:40 +02:00
Silvan Mosberger
374e6bcc40 treewide: Format all Nix files
Format all Nix files using the officially approved formatter,
making the CI check introduced in the previous commit succeed:

  nix-build ci -A fmt.check

This is the next step of the of the [implementation](https://github.com/NixOS/nixfmt/issues/153)
of the accepted [RFC 166](https://github.com/NixOS/rfcs/pull/166).

This commit will lead to merge conflicts for a number of PRs,
up to an estimated ~1100 (~33%) among the PRs with activity in the past 2
months, but that should be lower than what it would be without the previous
[partial treewide format](https://github.com/NixOS/nixpkgs/pull/322537).

Merge conflicts caused by this commit can now automatically be resolved while rebasing using the
[auto-rebase script](8616af08d9/maintainers/scripts/auto-rebase).

If you run into any problems regarding any of this, please reach out to the
[formatting team](https://nixos.org/community/teams/formatting/) by
pinging @NixOS/nix-formatting.
2025-04-01 20:10:43 +02:00
Aleksana
5fd2f5aac6 tailscaled: Add option to disable Taildrop (#346957) 2024-10-29 17:19:31 +08:00
Peder Bergebakken Sundt
233d422887 nixos/tailscale: document tailscale-autoconnect 2024-10-11 10:59:49 +02:00
Dionysis Grigoropoulos
8e9ae86774 tailscaled: Add option to disable Taildrop 2024-10-07 00:22:59 +03:00
Franz Pletz
1ee99a4837 tailscaled: after NetworkManager-wait-online (#344678) 2024-09-28 15:26:00 +02:00
Mikilio
938d190ed2 tailscale: add su to path
this adds access to `su` via security wrappers
2024-09-27 23:05:20 +02:00
Marin
0d822ccdbc tailscaled: after NetworkManager-wait-online
The wait will only be enabled on machines with NetworkManager enabled.

Closes #180175
2024-09-26 12:12:46 -04:00
Lucas Chaim
9e6338ffaf nixos/tailscale: add authKeyParameters
Adds `config.services.tailscale.authKeyParameters`
2024-09-26 07:28:19 -03:00
Michael Hoang
d25d241e38 Update nixos/modules/services/networking/tailscale.nix
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
2024-09-12 23:06:23 +10:00
Michael Hoang
185948bd01 tailscale: only autoconnect after backend is up
Previously, if this service started before the backend is up,
`StatusText` would be empty leading to the service trying to run
`tailscale up` even if this device is already logged in.
2024-08-30 01:27:40 +10:00
Kyungrok Chung
81a58be20b nixos/tailscale: add extraSetFlags to configure daemon 2024-05-11 03:01:54 +09:00
Tom
97bb1199c0 maintainers: remove twitchyliquid64
Yall won't miss me. The packages I leave orphaned are trivially updated as dependents need the new versions.

But passively endorsing the direction this organization and its leadership is something I can't do.

To those who still have faith in turning this around, you da real MVP 🖖
2024-04-26 22:48:31 -07:00
Dave Anderson
308cb342c9 maintainers: drop danderson 2024-04-26 11:36:50 -07:00
stuebinm
6afb255d97 nixos: remove all uses of lib.mdDoc
these changes were generated with nixq 0.0.2, by running

  nixq ">> lib.mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix
  nixq ">> mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix
  nixq ">> Inherit >> mdDoc[remove]" --batchmode nixos/**.nix

two mentions of the mdDoc function remain in nixos/, both of which
are inside of comments.

Since lib.mdDoc is already defined as just id, this commit is a no-op as
far as Nix (and the built manual) is concerned.
2024-04-13 10:07:35 -07:00
Sandro Jäckel
6753857664 nixos/tailscale: add option to pass flags to tailscaled 2024-02-27 20:08:08 +01:00
Sandro Jäckel
922351ec86 nixos/tailscale: make resolvconf package depending on enablement of module
If resolvconf is not enabled, trying to use it always fails because
/etc/resolvconf.conf contains an `exit 1`.
2024-01-25 15:50:36 +01:00
hellodword
26c2ed1c95 nixos/tailscale: fix after and wants 2023-12-24 09:44:46 +00:00
h7x4
79d3d59f58 treewide: replace mkPackageOptionMD with mkPackageOption 2023-11-30 19:03:14 +01:00
Evan Deaubl
9407ed628d nixos/tailscale: add openFirewall option 2023-10-20 15:57:40 -07:00
Muhammad Falak R Wani
3f141be99c tailscale: add mfrw as maintainer
Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
2023-08-23 08:32:33 +05:30
Jarosław Wygoda
2dbda3314f nixos/tailscale: add extraUpFlags option 2023-07-28 22:44:37 +02:00
Pol Dellaiera
a30cc10e7f Merge pull request #242703 from jwygoda/tailscaled-autoconnect
nixos/tailscale: add authKeyFile option
2023-07-24 04:48:42 +02:00
Jarosław Wygoda
7fc0e3334e nixos/tailscale: add authKeyFile option
Auth key registers new nodes without needing to sign in via a browser

Tailscale sends status changes with systemd-notify.
https://github.com/tailscale/tailscale/blob/v1.44.0/ipn/ipnlocal/local.go#L3670
2023-07-17 18:52:07 +02:00
chayleaf
4d4c73ff78 treewide: update path to getent 2023-07-12 02:32:23 +07:00
deinferno
26ff15b981 nixos/tailscale: fix ipv6 nat (v6nat) support 2023-06-16 12:18:55 +00:00
Emily Trau
949b1df785 nixos/tailscale: fix config priority conflict 2023-02-18 13:28:04 +11:00
Michael Hoang
68e514ed1c nixos/tailscale: Add useRoutingFeatures option 2022-12-17 22:38:14 +11:00
Jörg Thalheim
e24daea3d3 tailscale: improve formatting on warning message 2022-10-15 16:50:34 +02:00
pennae
ef176dcf7e nixos/*: automatically convert option descriptions
conversions were done using https://github.com/pennae/nix-doc-munge
using (probably) rev f34e145 running

    nix-doc-munge nixos/**/*.nix
    nix-doc-munge --import nixos/**/*.nix

the tool ensures that only changes that could affect the generated
manual *but don't* are committed, other changes require manual review
and are discarded.
2022-08-31 16:32:53 +02:00
pennae
2e751c0772 treewide: automatically md-convert option descriptions
the conversion procedure is simple:

 - find all things that look like options, ie calls to either `mkOption`
   or `lib.mkOption` that take an attrset. remember the attrset as the
   option
 - for all options, find a `description` attribute who's value is not a
   call to `mdDoc` or `lib.mdDoc`
 - textually convert the entire value of the attribute to MD with a few
   simple regexes (the set from mdize-module.sh)
 - if the change produced a change in the manual output, discard
 - if the change kept the manual unchanged, add some text to the
   description to make sure we've actually found an option. if the
   manual changes this time, keep the converted description

this procedure converts 80% of nixos options to markdown. around 2000
options remain to be inspected, but most of those fail the "does not
change the manual output check": currently the MD conversion process
does not faithfully convert docbook tags like <code> and <package>, so
any option using such tags will not be converted at all.
2022-07-30 15:16:34 +02:00
Sandro
366683965e Merge pull request #166308 from ncfavier/wg-resolvconf
nixos/resolvconf: allow different implementations
2022-07-10 21:00:00 +02:00
Naïm Favier
953a5bd3dd nixos/tailscale: use networking.resolvconf.package
Allow using the appropriate resolver implementation to set DNS entries
(typically systemd-resolved instead of openresolv).
2022-06-21 22:58:44 +02:00
Tom
3b8a162680 tailscale: ignore tailscale link when using networkd 2022-06-21 13:23:28 -07:00
David Anderson
3fdac0f981 nixos/tailscale: warn if strict reverse path filtering is in use.
Tailscale uses policy routing to enable certain traffic to bypass
routes that lead into the Tailscale mesh. NixOS's reverse path
filtering setup doesn't understand the policy routing at play,
and so incorrectly interprets some of this traffic as spoofed.

Since this only breaks some features of Tailscale, merely warn
users about it, rather than make it a hard error.

Updates tailscale/tailscale#4432

Signed-off-by: David Anderson <dave@natulte.net>
2022-05-05 18:28:48 -07:00
Sandro
b9e7f61c72 Merge pull request #171747 from danderson/danderson/tailscale-getent
nixos/tailscale: add glibc to PATH.
2022-05-06 03:10:00 +02:00
David Anderson
67b1fac192 nixos/tailscale: add glibc to PATH.
For some features, tailscaled uses getent(1) to get the shell
of OS users. getent(1) is in the glibc derivation. Without this
derivation in the path, tailscale falls back to /bin/sh for all
users.

Signed-off-by: David Anderson <dave@natulte.net>
2022-05-05 17:09:27 -07:00
David Anderson
c9a1647ade nixos/tailscale: use systemctl restart during activation.
This avoids the scenario where you activate a new config over Tailscale,
and a long delay between the "stop services" and "start services" phases
of the activation script lead to your terminal freezing for tens of
seconds, until tailscaled finally gets started again and the session
recovers.

Per the documentation of stopIfChanged, this is only safe to do if the
service definition is robust to stopping the old process using the new
service definition. As the maintainer of the upstream systemd unit, I
can confirm that Tailscale is robust to this scenario: it has to be
in order to work right on several other distros that just do
unpack-then-restart, rather than the more complex stop-unpack-start
dance.

Signed-off-by: David Anderson <dave@natulte.net>
2022-04-24 23:31:35 -07:00
Thomas Gerbet
f89894e2e3 nixos/tailscale: allow to set TS_PERMIT_CERT_UID env variable
This setting was introduced with Tailscale 1.22.0, see
https://github.com/tailscale/tailscale/releases/tag/v1.22.0

Co-authored-by: pennae <github@quasiparticle.net>
2022-04-17 12:13:24 +02:00
Naïm Favier
2ddc335e6f nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
Luke Granger-Brown
ef4e133b1c Merge branch 'master' into Xe/tailscale-sysctl-not-found 2021-06-30 23:10:54 +01:00
Profpatsch
799cdbd834 tailscale: add interfaceName option
tailscale allows to specify the interface name.
The upstream systemd unit does not expose it directly however, only
via the `FLAGS` environment variable.

I can’t be 100% sure that the escaping is correct, but this is as good
as we can do for now, unless upstream changes their unit file.
2021-06-14 11:25:08 +02:00
Christine Dodrill
2b220cc57b nixos/tailscale: add procps to $PATH
Currently tailscaled expects `sysctl` (from package procps) to be present
in the path when running on Linux. It can function without the `sysctl`
command present but it prints an error about it. This fixes that error.

    Warning: couldn't check net.ipv4.ip_forward (exec: "sysctl":
        executable file not found in $PATH).

Signed-off-by: Christine Dodrill <me@christine.website>
2021-06-06 14:17:03 +00:00
Frederik Rietdijk
b9ef51a84b services.tailscale: add openresolv to path
Without openresolv, magic dns is not very usable.
2021-04-07 18:40:04 +02:00
Christine Dodrill
3d55480bf8 nixos/tailscale: add package as an option
This simplifies testing changes to the tailscale service on a local
machine. You can use this as such:

```nix
let
  tailscale_patched = magic {};
in {
  services.tailscale = {
    enable = true;
    package = tailscale_patched;
  };
};
```

Signed-off-by: Christine Dodrill <me@christine.website>
2020-12-01 12:30:31 +01:00
David Anderson
503caab776 nixos/tailscale: use upstream systemd service config.
Signed-off-by: David Anderson <dave@natulte.net>
2020-11-03 19:37:48 -08:00