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
This commit is contained in:
Kristoffer Dalby committed 2026-11-11 12:19:29 +01:00
1 parent bff13ee823
commit 7e0e423fbf
17 files changed
+1175 -949

No files matched your search

+3 -3
View File
@@ -484,9 +484,9 @@ func TestLoadConfig(t *testing.T) {
}
}
// TestCLIOnlyConfig: a file with only what client commands read, as the
// NixOS module writes to /etc/headscale/config.yaml, serves them; check
// config reports what the server lacks.
// TestCLIOnlyConfig: a file with only what client commands read, such as
// ~/.config/headscale/config.yaml, serves them; check config reports what
// the server lacks.
func TestCLIOnlyConfig(t *testing.T) {
path := writeFile(t, t.TempDir(), "config.yaml", `cli:
address: headscale.example.com:443