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 71d052e737
commit eadb1e35ce
20 changed files with 219 additions and 191 deletions
+8 -8
View File
@@ -1,8 +1,8 @@
{ config, lib, pkgs, ... }:
{ config, lib, pkgs, vars, ... }:
{
fileSystems."/mnt/docker/config" = {
device = "server:/tank/docker/config";
device = "${vars.nfsServerHost}:${vars.storageRoot}/docker/config";
fsType = "nfs";
options = [
@@ -14,7 +14,7 @@
};
fileSystems."/mnt/docker/databases" = {
device = "server:/tank/docker/databases";
device = "${vars.nfsServerHost}:${vars.storageRoot}/docker/databases";
fsType = "nfs";
options = [
@@ -26,7 +26,7 @@
};
fileSystems."/mnt/docker/volumes" = {
device = "server:/tank/docker/volumes";
device = "${vars.nfsServerHost}:${vars.storageRoot}/docker/volumes";
fsType = "nfs";
options = [
@@ -37,8 +37,8 @@
];
};
fileSystems."/mnt/nextcloud-data" = {
device = "server:/tank/docker/nextcloud-data";
fileSystems."/mnt/nextcloud-data" = {
device = "${vars.nfsServerHost}:${vars.storageRoot}/docker/nextcloud-data";
fsType = "nfs";
options = [
@@ -49,8 +49,8 @@
];
};
fileSystems."/mnt/raspi-backup" = {
device = "server:/tank/raspi/volumes";
fileSystems."/mnt/raspi-backup" = {
device = "${vars.nfsServerHost}:${vars.storageRoot}/raspi/volumes";
fsType = "nfs";
options = [