1
1
Fork 1
mirror of https://github.com/oddlama/nix-config.git synced 2025-10-10 23:00:39 +02:00

feat(topology): extract more service info and add helper functions to define stuff

This commit is contained in:
oddlama 2024-04-01 02:26:52 +02:00
parent cc35dd599a
commit 30579a433e
No known key found for this signature in database
GPG key ID: 14EFE510775FE39A
12 changed files with 174 additions and 175 deletions

View file

@ -20,6 +20,9 @@
./net.nix
];
topology.self.hardware.info = "AMD Ryzen Threadripper 1950X, 96GB RAM";
topology.self.interfaces.lan.sharesNetworkWith = x: x == "lan-self";
boot.mode = "efi";
boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "e1000e" "alx"];
@ -81,6 +84,13 @@
networking.nftables.firewall = {
zones.untrusted.interfaces = [config.guests.${guestName}.networking.mainLinkName];
};
topology.self.interfaces.lan.physicalConnections = [
{
node = config.node.name;
interface = "lan-self";
renderer.reverse = true;
}
];
}
];
};

View file

@ -64,6 +64,7 @@ in {
}
];
topology.self.services.loki.info = "https://" + lokiDomain;
services.loki = let
lokiDir = "/var/lib/loki";
in {

View file

@ -23,26 +23,7 @@
topology.self.hardware.image = ../../odroid-h3.png;
topology.self.hardware.info = "ODROID H3, 64GB RAM";
# TODO FIXME topology bogus
topology.self.interfaces.lan-self.physicalConnections = [
{
node = config.node.name;
interface = "lan";
}
];
topology.self.interfaces.lan.physicalConnections =
lib.flip map [
"adguardhome"
"forgejo"
"kanidm"
"radicale"
"vaultwarden"
] (
x: {
node = "ward-${x}";
interface = "lan";
}
);
topology.self.interfaces.lan.sharesNetworkWith = x: x == "lan-self";
boot.mode = "efi";
boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" "r8169"];
@ -87,6 +68,13 @@
networking.nftables.firewall = {
zones.untrusted.interfaces = [config.guests.${guestName}.networking.mainLinkName];
};
topology.self.interfaces.lan.physicalConnections = [
{
node = config.node.name;
interface = "lan-self";
renderer.reverse = true;
}
];
}
];
};

View file

@ -48,6 +48,7 @@ in {
allowedUDPPorts = [53];
};
topology.self.services.adguardhome.info = "https://" + adguardhomeDomain;
services.adguardhome = {
enable = true;
# TODO allow mutable settings, replace 123.123.123.123 with

View file

@ -43,6 +43,7 @@ in {
}
];
topology.self.services.radicale.info = "https://" + radicaleDomain;
services.radicale = {
enable = true;
settings = {