Add shared services infrastructure for cross-host data

Created centralized service definitions in shared/services.nix to store
service metadata (domains, IPs, ports) that need to be accessible across
multiple hosts. This replaces the per-service split DNS module approach
with a single source of truth.

Services are now exported through utils.nix for easy access in host configs.
This commit is contained in:
William 2025-11-08 21:35:13 -03:00
parent 2289f0e6e4
commit af444584d0
3 changed files with 63 additions and 61 deletions

View file

@ -1,39 +0,0 @@
{
config,
lib,
inputs,
...
}:
let
utils = import ../../utils.nix { inherit inputs lib; };
inherit (utils) mkNginxVHosts;
in
{
virtualisation.oci-containers.containers."librespeed" = {
image = "lscr.io/linuxserver/librespeed:latest";
environment = {
TZ = "America/Bahia";
};
ports = [ "127.0.0.1:58080:80" ];
extraOptions = [
"--pull=newer"
"--label=io.containers.autoupdate=registry"
];
};
services.nginx.virtualHosts = mkNginxVHosts {
acmeHost = "baduhai.dev";
domains."speedtest.baduhai.dev".locations."/".proxyPass = "http://127.0.0.1:58080/";
};
# Register this domain for split DNS
services.splitDNS.entries = [
{
domain = "speedtest.baduhai.dev";
lanIP = "192.168.15.142";
tailscaleIP = "100.76.19.50";
}
];
}