From ad61336a203381c1fdecc999c221b2d4eda0c1ad Mon Sep 17 00:00:00 2001 From: h7x4 Date: Tue, 30 Dec 2025 02:53:39 +0900 Subject: [PATCH] topology: add a bunch of non-nixos machines --- topology/default.nix | 41 +++++++++++++----- topology/non-nixos-machines.nix | 75 +++++++++++++++++++++++++++++++++ 2 files changed, 105 insertions(+), 11 deletions(-) create mode 100644 topology/non-nixos-machines.nix diff --git a/topology/default.nix b/topology/default.nix index eb1cd93..a34f454 100644 --- a/topology/default.nix +++ b/topology/default.nix @@ -10,6 +10,10 @@ let mkConnectionRev; values = import ../values.nix; in { + imports = [ + ./non-nixos-machines.nix + ]; + ### Networks networks.pvv = { @@ -29,6 +33,8 @@ in { networks.ntnu = { name = "NTNU"; + cidrv4 = values.ntnu.ipv4-space; + cidrv6 = values.ntnu.ipv6-space; }; nodes.internet = mkInternet { @@ -54,17 +60,30 @@ in { nodes.brus-switch = mkSwitch "Brus Switch" { interfaceGroups = [ (lib.genList (i: "eth${toString i}") 16) ]; - connections.eth2 = mkConnection "bekkalokk" "enp2s0"; - # connections.eth3 = mkConnection "bicep" "enp6s0f0"; - connections.eth4 = mkConnection "buskerud" "eth1"; - connections.eth5 = mkConnection "knutsen" "eth1"; - connections.eth6 = mkConnection "powerpuff-cluster" "eth1"; - - connections.eth8 = mkConnection "lupine-1" "enp0s31f6"; - connections.eth9 = mkConnection "lupine-2" "enp0s31f6"; - connections.eth11 = mkConnection "lupine-3" "enp0s31f6"; - connections.eth10 = mkConnection "lupine-4" "enp0s31f6"; - connections.eth12 = mkConnection "lupine-5" "enp0s31f6"; + connections = let + connections' = [ + (mkConnection "bekkalokk" "enp2s0") + # (mkConnection "bicep" "enp6s0f0") + (mkConnection "buskerud" "eth1") + (mkConnection "knutsen" "eth1") + (mkConnection "powerpuff-cluster" "eth1") + (mkConnection "lupine-1" "enp0s31f6") + (mkConnection "lupine-2" "enp0s31f6") + (mkConnection "lupine-3" "enp0s31f6") + (mkConnection "lupine-4" "enp0s31f6") + (mkConnection "lupine-5" "enp0s31f6") + (mkConnection "innovation" "em0") + (mkConnection "microbel" "eth0") + # (mkConnection "isvegg" "") + # (mkConnection "ameno" "") + # (mkConnection "sleipner" "") + ]; + in builtins.listToAttrs ( + lib.zipListsWith + (a: b: lib.nameValuePair a b) + (lib.genList (i: "eth${toString i}") 16) + connections' + ); }; nodes.knutsen = mkRouter "knutsen" { diff --git a/topology/non-nixos-machines.nix b/topology/non-nixos-machines.nix new file mode 100644 index 0000000..77222a6 --- /dev/null +++ b/topology/non-nixos-machines.nix @@ -0,0 +1,75 @@ +{ config, lib, ... }: +let + inherit (config.lib.topology) mkDevice; +in { + nodes.balduzius = mkDevice "balduzius" { + guestType = "proxmox"; + parent = config.nodes.powerpuff-cluster.id; + }; + nodes.tom = mkDevice "tom" { + guestType = "proxmox"; + parent = config.nodes.powerpuff-cluster.id; + }; + nodes.hildring = mkDevice "hildring" { + guestType = "proxmox"; + parent = config.nodes.powerpuff-cluster.id; + }; + nodes.microbel = mkDevice "microbel" { + interfaceGroups = [ [ "eth0" ] ]; + }; + nodes.innovation = mkDevice "innovation" { + hardware.info = "Dell Optiplex 9010"; + interfaceGroups = [ [ "em0" ] ]; + interfaces.em0 = { + mac = "18:03:73:20:18:d3"; + addresses = [ + "129.241.210.214" + "2001:700:300:1900::1:56" + ]; + gateways = [ + "129.241.210.129" + "2001:700:300:1900::1" + ]; + }; + services = { + minecraft = { + name = "Minecraft"; + icon = "services.minecraft"; + info = "minecraft.pvv.ntnu.no"; + details.listen.text = "0.0.0.0:25565"; + }; + }; + }; + nodes.principal = mkDevice "principal" { + interfaceGroups = [ [ ] ]; + }; + nodes.sleipner = mkDevice "sleipner" { + interfaceGroups = [ [ "eno0" "enp2s0" ] ]; + }; + nodes.isvegg = mkDevice "isvegg" { + interfaceGroups = [ [ ] ]; + }; + nodes.ameno = mkDevice "ameno" { + interfaceGroups = [ [ ] ]; + }; + nodes.skrott = mkDevice "skrott" { + deviceType = "terminal"; + interfaceGroups = [ [ ] ]; + }; + nodes.torskas = mkDevice "torskas" { + deviceType = "terminal"; + interfaceGroups = [ [ ] ]; + }; + nodes.wegonke = mkDevice "wegonke" { + deviceType = "terminal"; + interfaceGroups = [ [ ] ]; + }; + nodes.demiurgen = mkDevice "demiurgen" { + deviceType = "terminal"; + interfaceGroups = [ [ ] ]; + }; + nodes.sanctuary = mkDevice "sanctuary" { + deviceType = "terminal"; + interfaceGroups = [ [ ] ]; + }; +}