Centralize shared values into variables.nix

One file (variables.nix) holding every value that was previously
hardcoded and repeated across modules: LAN domain/CIDR, home/tailnet
domains, cross-host references (nix-cache substituter hostname, NFS
server hostname, remote-builder user), PXE/PBS IPs, timezone, and the
primary username.

Wired in via flake.nix's specialArgs (and home-manager's
extraSpecialArgs for the two home.nix files), so any module picks it
up by just adding `vars` to its function arguments — no explicit
import needed. Two hosts (nix-cache, server) now derive their own
networking.hostName from the same variable other hosts use to reach
them, so there's exactly one place to change either identifier.

Purely mechanical: every substituted value matches what was already
there, confirmed by identical toplevel .drv paths for all 17 targets
before and after.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-19 14:51:37 +10:00
co-authored by Claude Sonnet 5
parent 2f7831aea8
commit 6dcbae5659
20 changed files with 219 additions and 191 deletions
+3 -3
View File
@@ -1,7 +1,7 @@
{ config, ... }:
{ config, vars, ... }:
{
networking.hostName = "server";
networking.hostName = vars.nfsServerHost;
networking.hostId = "6689f93e";
sops.secrets."beszel-token".sopsFile = ../../secrets/server.yaml;
@@ -13,7 +13,7 @@
#DOCKER_HOST = "tcp://docker-socket-proxy:2375";
#HUB_URL = "http://docker.sweet.home:8090";
KEY = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFPR9kwtC4TAeTRu46A7+opZsYpxqkRJ+x/ZyB2GWCeG";
EXTRA_FILESYSTEMS = "/tank/docker/volumes";
EXTRA_FILESYSTEMS = "${vars.storageRoot}/docker/volumes";
LOG_LEVEL = "debug";
};
services.beszel.agent.environmentFile = config.sops.templates."server-beszel.env".path;