diff --git a/CHANGELOG.md b/CHANGELOG.md index f1367335c..4bf76ac07 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -202,6 +202,10 @@ the `tailscale.com/cap/tailsql` app capability lets a user query it; see - `settings.ephemeral_node_inactivity_timeout` is removed; set `settings.node.ephemeral.inactivity_timeout`, which headscale reads instead - `settings.dns.split` is removed; headscale never read it, set `settings.dns.nameservers.split` - `settings.tls_*` options move to `settings.tls.*`; old `settings.tls_*` values still work [#3554](https://github.com/juanfont/headscale/pull/3554) +- A config, or a Nix store file policy, that headscale rejects now fails the build; a config or a file it names that headscale rejects fails a switch before headscale restarts. Turn the checks off with `check.config = false` and `check.policy = false`; see `nix/README.md` [#3682](https://github.com/juanfont/headscale/pull/3682) +- `user` and `group` are read-only; headscale always runs as `headscale:headscale` [#3682](https://github.com/juanfont/headscale/pull/3682) +- A `settings.cli` key fails evaluation; the server never reads `cli.*`, and it would be written to the Nix store [#3682](https://github.com/juanfont/headscale/pull/3682) +- `nixosModules.default` now defaults `services.headscale.package` to this flake's headscale instead of `pkgs.headscale`, because the checks need `headscale check` [#3682](https://github.com/juanfont/headscale/pull/3682) ### Changes diff --git a/nix/README.md b/nix/README.md index 08ce55c19..aed0fe62f 100644 --- a/nix/README.md +++ b/nix/README.md @@ -12,8 +12,6 @@ aim to be upstreamed to nixpkgs. ## Files - **[`module.nix`](./module.nix)** - The NixOS module implementation -- **[`example-configuration.nix`](./example-configuration.nix)** - Example - configuration demonstrating all major features - **[`testkit.nix`](./testkit.nix)**, **[`testkit-peer.nix`](./testkit-peer.nix)** - Test kit: a control node for NixOS VM tests of Tailscale clients, and a peer that joins it (see below) @@ -33,8 +31,38 @@ Then import the module: imports = [ inputs.headscale.nixosModules.default ]; ``` -See [`example-configuration.nix`](./example-configuration.nix) for configuration -options. +Each `services.headscale.settings` option is one key of +[Configuration options](https://headscale.net/stable/ref/configuration-options/). + +The flake's module defaults `services.headscale.package` to the flake's +headscale. Another package must provide `headscale check` while the checks +below are on. + +## Checks + +`services.headscale.check.config` and `check.policy` run `headscale check` on +the new config and policy: while building the system, and before a switch +restarts headscale. Their descriptions in [`module.nix`](./module.nix) say what +each runs. + +To skip a check: + +- A config that is valid only with the unit's `EnvironmentFile` or %-specifiers + fails: set `check.config = false`. +- `check.config` checks the policy before a switch too: set both to `false` to + skip every policy check. +- `NIXOS_NO_CHECK=1 nixos-rebuild switch` skips the switch check once. + +Limits of the switch check: + +- It runs before activation, so it sees files as they were: `/etc` entries, + sops-nix or agenix secrets and new users arrive after it. A `headscale` user + or group that does not exist yet skips it. +- `nixos-rebuild switch` sets the system profile before it, and does not undo + it. The boot menu is not updated, so a reboot starts the old generation. + `nixos-rebuild switch --rollback` resets the profile. +- A pass does not prove that migrations, the network, an OIDC provider or the + listeners work. ## Test kit