Commit Graph
22 Commits
Author SHA1 Message Date
Kristoffer Dalby 4e8ddfef25 nix: keep only distro facts as module defaults
State paths, socket and disable_check_updates; headscale's defaults cover
the rest. headscale-docker gains a CA bundle to fetch HTTPS DERP maps.

Updates #1926
2026-11-11 15:02:16 +01:00
Kristoffer Dalby 6247fc59e5 nix, docs: regenerate NixOS options and the configuration reference
Updates #1926
2026-11-11 15:02:16 +01:00
Kristoffer Dalby fcb1d42b86 nix: check the configuration while building the system
check.config also runs `check config -f` on the generated file at build
time, native only, under the unit's environment.

Updates #1926
2026-11-11 15:02:16 +01:00
Kristoffer Dalby 3a35f74873 nix: build the module on the generated options
settings mirrors headscale's keys one to one, headscale's checks judge the
rest, and the local CLI gets the socket from a variable instead of a file.

headscale always runs as headscale:headscale, which the module creates;
user and group are read-only, so setting either fails evaluation, and stay
only because nixpkgs' headplane module reads them. A settings.cli key
fails evaluation instead of being dropped with a warning, and the unit no
longer gets CAP_CHOWN.
nix/example-configuration.nix goes: the options carry its examples and
defaults.

Updates #1926
2026-11-11 15:02:16 +01:00
Kristoffer Dalby afa16d056e nix, docs: regenerate NixOS options and the configuration reference
Read-only file options take Nix paths; key and state file options take
only absolute paths outside the Nix store; DNS records pass unknown
fields; db_password_file and dns.split appear as removed keys.

Updates #1926
2026-11-11 15:02:16 +01:00
Kristoffer Dalby 0844b7649d nix: check the policy at build time and the config before a switch
Store-path policy: check policy -f in system.checks.
Pre-switch: check all as the headscale user.
Adapted: no file: secret warning; groups as after activation; a new primary
group skips; the policy the unit's env selects; docs say which check covers
the policy; VM case for the unit's env.

(cherry picked from commit b6ba6e42ee)

Fixes #2898
Updates #1926
2026-11-11 15:02:16 +01:00
Kristoffer Dalby fe908c2d5a goreleaser: generate shipped config files, remove config-example.yaml
Updates #1926
2026-11-11 15:02:16 +01:00
Kristoffer Dalby 8405c248e1 nix: add generated NixOS options
Updates #1926
2026-11-11 15:02:16 +01:00
Kristoffer Dalby cb4ccd97c2 types: reject unknown and removed config keys
Fixes #1926
2026-11-11 15:02:16 +01:00
Kristoffer Dalby 8b41925a1f nix: support systemctl reload in the headscale service
Fixes #3027

Claude-Session: https://claude.ai/code/session_01RHEZM1qJ2hgndiXio7P56h
2026-11-03 15:52:52 +01:00
Kristoffer Dalby ed854650f0 nix: declare nested tls options
Old settings.tls_* keys pass through to headscale, which still reads them;
new options default to null so they do not shadow them.

Updates #2527
2026-10-18 20:53:18 +02:00
Kristoffer Dalby 7ed3dead3e nix: add dns.certificates and dns.challenge options
Updates #2137
2026-10-18 20:53:18 +02:00
Kristoffer Dalby 00663fbbfe nix: run the headscale VM test on the test kit
Drops nginx, the cert and dead ip_prefixes. Proves DERP relay and TLS noise
after a restart, and puts nix/module.nix under CI.
2026-09-28 21:42:19 +02:00
Kristoffer Dalby 200c2c01e8 nix: add a NixOS test kit for Tailscale clients
nixosModules.testkit makes a node a control server every client joins without
trust setup; testkit-peer joins it with hs-join.
2026-09-28 21:42:19 +02:00
Kristoffer Dalby d48883ca9b nix: write split DNS where headscale reads it
module.nix emitted dns.split; headscale reads dns.nameservers.split, so the
typed option was silently ignored. Old path now asserts.
2026-09-28 21:42:19 +02:00
Kristoffer Dalby f0ff407c05 nix: stop module.nix writing the deprecated ephemeral key
Its default made headscale warn on every start. The camelCase rename now
targets node.ephemeral.inactivity_timeout, and the old path asserts.
2026-09-28 21:42:19 +02:00
Kristoffer Dalby 8d89742a21 flake: format Nix with nixfmt
flake-checks moved its treefmt Nix formatter to nixfmt, so every .nix file
failed the formatting check. The devShell and the pre-commit hook shipped
nixpkgs-fmt, which reformatted them straight back.
2026-09-25 15:52:26 +02:00
Florian Preinstorfer f1494a32ce Update links to Tailscale documentation 2026-04-18 09:33:41 +02:00
Kristoffer Dalby 4d0b273b90 types: add node.expiry config, deprecate oidc.expiry
Introduce a structured NodeConfig that replaces the flat
EphemeralNodeInactivityTimeout field with a nested Node section.

Add node.expiry config (default: no expiry) as the unified default key
expiry for all non-tagged nodes regardless of registration method.

Remove oidc.expiry entirely — node.expiry now applies to OIDC nodes
the same as all other registration methods. Using oidc.expiry in the
config is a hard error. determineNodeExpiry() returns nil (no expiry)
unless use_expiry_from_token is enabled, letting state.go apply the
node.expiry default uniformly.

The old ephemeral_node_inactivity_timeout key is preserved for
backwards compatibility.

Updates #1711
2026-04-08 13:00:22 +01:00
Kristoffer Dalby 65880ecb58 nix: disable external DERP URL fetch in VM test
Explicitly set derp.urls to an empty list in the NixOS VM test,
matching the upstream nixpkgs test. The VMs have no internet
access, so fetching the default Tailscale DERP map would silently
fail and add unnecessary timeout delay to the test run.
2026-03-06 05:18:44 -08:00
Kristoffer Dalby 37c6a9e3a6 nix: sync module options and descriptions with upstream nixpkgs
Add missing typed options from the upstream nixpkgs module:
- configFile: read-only option exposing the generated config path
  for composability with other NixOS modules
- dns.split: split DNS configuration with proper type checking
- dns.extra_records: typed submodule with name/type/value validation

Sync descriptions and assertions with upstream:
- Use Tailscale doc link for override_local_dns description
- Remove redundant requirement note from nameservers.global
- Match upstream assertion message wording and expression style

Update systemd script to reference cfg.configFile instead of a
local let-binding, matching the upstream pattern.
2026-03-06 05:18:44 -08:00
Kristoffer Dalby d14be8d43b nix: add NixOS module and tests (#2857) 2025-11-12 13:11:38 +00:00