Archived
Extract ports, docker host, and remote-builder keys into variables.nix
Pulls the beszel hub / PVE / PBS ports, the docker-compose host's LAN name, and the remote-builder client SSH keys out of scattered inline literals across modules/hosts and into variables.nix as the single source of truth, matching the existing pattern for other cross-host references (nixCacheHost, nfsServerHost). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01La55Nsss8jZ7ZuzUV9mfot
This commit is contained in:
@@ -39,7 +39,7 @@
|
|||||||
[Desktop Entry]
|
[Desktop Entry]
|
||||||
Type=Application
|
Type=Application
|
||||||
Name=Proxmox (Chromium)
|
Name=Proxmox (Chromium)
|
||||||
Exec=chromium --app=https://pve.${vars.homeDomain}:8006 --window-size=1920,1080 --window-position=0,0
|
Exec=chromium --app=https://pve.${vars.homeDomain}:${toString vars.pveWebPort} --window-size=1920,1080 --window-position=0,0
|
||||||
Icon=${config.home.homeDirectory}/.local/share/icons/proxmox.png
|
Icon=${config.home.homeDirectory}/.local/share/icons/proxmox.png
|
||||||
Terminal=false
|
Terminal=false
|
||||||
Categories=Hypervisor;
|
Categories=Hypervisor;
|
||||||
@@ -49,7 +49,7 @@
|
|||||||
[Desktop Entry]
|
[Desktop Entry]
|
||||||
Type=Application
|
Type=Application
|
||||||
Name=Proxmox Backup Server (Chromium)
|
Name=Proxmox Backup Server (Chromium)
|
||||||
Exec=chromium --app=https://${vars.pbsIp}:8007 --window-size=1920,1080 --window-position=0,0
|
Exec=chromium --app=https://${vars.pbsIp}:${toString vars.pbsWebPort} --window-size=1920,1080 --window-position=0,0
|
||||||
Icon=${config.home.homeDirectory}/.local/share/icons/proxmox.png
|
Icon=${config.home.homeDirectory}/.local/share/icons/proxmox.png
|
||||||
Terminal=false
|
Terminal=false
|
||||||
Categories=backup;
|
Categories=backup;
|
||||||
@@ -59,7 +59,7 @@
|
|||||||
[Desktop Entry]
|
[Desktop Entry]
|
||||||
Type=Application
|
Type=Application
|
||||||
Name=Proxmox (Firefox)
|
Name=Proxmox (Firefox)
|
||||||
Exec=firefox --new-instance https://pve.${vars.homeDomain}:8006 --profile ProxmoxWebApp --window-size=1920,1080 --class ProxmoxWebApp
|
Exec=firefox --new-instance https://pve.${vars.homeDomain}:${toString vars.pveWebPort} --profile ProxmoxWebApp --window-size=1920,1080 --class ProxmoxWebApp
|
||||||
Icon=${config.home.homeDirectory}/.local/share/icons/proxmox.png
|
Icon=${config.home.homeDirectory}/.local/share/icons/proxmox.png
|
||||||
Terminal=false
|
Terminal=false
|
||||||
Categories=Hypervisor;
|
Categories=Hypervisor;
|
||||||
@@ -69,7 +69,7 @@
|
|||||||
[Desktop Entry]
|
[Desktop Entry]
|
||||||
Type=Application
|
Type=Application
|
||||||
Name=Proxmox Backup Server (Firefox)
|
Name=Proxmox Backup Server (Firefox)
|
||||||
Exec=firefox --new-window https://${vars.pbsIp}:8007 --profile PbsWebApp --window-size=1920,1080 --class PbsWebApp
|
Exec=firefox --new-window https://${vars.pbsIp}:${toString vars.pbsWebPort} --profile PbsWebApp --window-size=1920,1080 --class PbsWebApp
|
||||||
Icon=${config.home.homeDirectory}/.local/share/icons/proxmox.png
|
Icon=${config.home.homeDirectory}/.local/share/icons/proxmox.png
|
||||||
Terminal=false
|
Terminal=false
|
||||||
Categories=backup;
|
Categories=backup;
|
||||||
|
|||||||
@@ -4,6 +4,6 @@
|
|||||||
services.beszel.agent.enable = true;
|
services.beszel.agent.enable = true;
|
||||||
services.beszel.agent.environment = {
|
services.beszel.agent.environment = {
|
||||||
#DOCKER_HOST = "tcp://docker-socket-proxy:2375";
|
#DOCKER_HOST = "tcp://docker-socket-proxy:2375";
|
||||||
HUB_URL = "http://docker.${vars.homeDomain}:8090";
|
HUB_URL = "http://${vars.dockerHost}.${vars.homeDomain}:${toString vars.beszelHubPort}";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,17 +34,10 @@
|
|||||||
createHome = true;
|
createHome = true;
|
||||||
home = "/var/lib/nixremote";
|
home = "/var/lib/nixremote";
|
||||||
shell = pkgs.bashInteractive;
|
shell = pkgs.bashInteractive;
|
||||||
# Provide remote builder public keys here (safe to commit public keys only):
|
# Client public keys allowed to use this host as a remote builder —
|
||||||
# openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAA... client@host" ];
|
# single source of truth is vars.remoteBuilderAuthorizedKeys (safe to
|
||||||
#
|
# commit public keys only).
|
||||||
# Avoid absolute keyFiles paths here because they break pure flake evaluation.
|
openssh.authorizedKeys.keys = vars.remoteBuilderAuthorizedKeys;
|
||||||
openssh.authorizedKeys.keys = [
|
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFDEA1S2ikpObREgbP5uVBWMxIOGbY8B+Wx7VTZK1m6t root@server"
|
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPAYIT9ormlmxZ0SziyDQaUntnKI8HK9/s3Qac1ZKjP2 root@docker"
|
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKKKzoEPl/ZW9KBRHBcp6/ThOngGpwMv5EhkTlgC4aDf root@nixos"
|
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIGtOWOCS+ImHc7NehguoyD7PbonGosKMZqc9+QR3v/h root@nixos"
|
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHxXTQxFnArK5HXG7czeoybZebCGfxpUdusJkPn+BCSp root@server"
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
services.openssh.enable = true;
|
services.openssh.enable = true;
|
||||||
|
|||||||
@@ -10,13 +10,30 @@
|
|||||||
# Cross-host references (LAN hostnames/users other hosts reach over the network)
|
# Cross-host references (LAN hostnames/users other hosts reach over the network)
|
||||||
nixCacheHost = "nix-cache"; # substituter/remote-builder hostname
|
nixCacheHost = "nix-cache"; # substituter/remote-builder hostname
|
||||||
nfsServerHost = "server"; # NFS export source hostname
|
nfsServerHost = "server"; # NFS export source hostname
|
||||||
|
dockerHost = "docker"; # docker-compose stack host
|
||||||
|
|
||||||
remoteBuilderUser = "nixremote"; # remote builder SSH user
|
remoteBuilderUser = "nixremote"; # remote builder SSH user
|
||||||
|
|
||||||
|
# Public keys authorized to SSH in as remoteBuilderUser on the nix-cache
|
||||||
|
# host (modules/nix-cache/server.nix) — one per client host that's allowed
|
||||||
|
# to use it as a distributed builder.
|
||||||
|
remoteBuilderAuthorizedKeys = [
|
||||||
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFDEA1S2ikpObREgbP5uVBWMxIOGbY8B+Wx7VTZK1m6t root@server"
|
||||||
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPAYIT9ormlmxZ0SziyDQaUntnKI8HK9/s3Qac1ZKjP2 root@docker"
|
||||||
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKKKzoEPl/ZW9KBRHBcp6/ThOngGpwMv5EhkTlgC4aDf root@nixos"
|
||||||
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIGtOWOCS+ImHc7NehguoyD7PbonGosKMZqc9+QR3v/h root@nixos"
|
||||||
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHxXTQxFnArK5HXG7czeoybZebCGfxpUdusJkPn+BCSp root@server"
|
||||||
|
];
|
||||||
|
|
||||||
# System
|
# System
|
||||||
timeZone = "Australia/Brisbane";
|
timeZone = "Australia/Brisbane";
|
||||||
primaryUser = "nixos"; # main interactive user on every host
|
primaryUser = "nixos"; # main interactive user on every host
|
||||||
|
|
||||||
# Storage
|
# Storage
|
||||||
storageRoot = "/tank"; # ZFS pool root on `server`
|
storageRoot = "/tank"; # ZFS pool root on `server`
|
||||||
|
|
||||||
|
# Well-known ports for LAN services referenced from multiple hosts
|
||||||
|
beszelHubPort = 8090;
|
||||||
|
pveWebPort = 8006;
|
||||||
|
pbsWebPort = 8007;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user