From 243b665eaeb4bd700fa8279f7820d41831be13e6 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Tue, 30 Dec 2025 14:06:18 +0900 Subject: [PATCH] topology: extend some more --- topology/default.nix | 109 ++++++++++++++++++++------- topology/icons/proxmox.svg | 5 ++ topology/non-nixos-machines.nix | 128 +++++++++++++++++++++++++++++++- 3 files changed, 211 insertions(+), 31 deletions(-) create mode 100644 topology/icons/proxmox.svg diff --git a/topology/default.nix b/topology/default.nix index fda50ec..8f3f11c 100644 --- a/topology/default.nix +++ b/topology/default.nix @@ -52,11 +52,27 @@ in { nodes.ntnu-pvv-router = mkRouter "NTNU PVV Gateway" { interfaceGroups = [ ["wan1"] ["eth1"] ]; - connections.eth1 = mkConnection "brus-switch" "eth0"; + connections.eth1 = mkConnection "knutsen" "em1"; interfaces.eth1.network = "pvv"; }; - nodes.brus-switch = mkSwitch "Brus Switch" { + nodes.knutsen = mkRouter "knutsen" { + deviceIcon = "${pkgs.super-tiny-icons}/share/icons/SuperTinyIcons/svg/freebsd.svg"; + + interfaceGroups = [ ["em0"] ["em1"] ["vpn1"] ]; + + connections.em0 = mkConnection "nintendo" "eth0"; + + # connections.vpn1 = mkConnection "ludvigsen" "vpn1"; + interfaces.vpn1.network = "site-vpn"; + interfaces.vpn1.virtual = true; + interfaces.vpn1.icon = "${pkgs.super-tiny-icons}/share/icons/SuperTinyIcons/svg/openvpn.svg"; + + interfaces.em0.network = "pvv"; + interfaces.em1.network = "ntnu"; + }; + + nodes.nintendo = mkSwitch "Nintendo (brus switch)" { interfaceGroups = [ (lib.genList (i: "eth${toString i}") 16) ]; connections = let @@ -64,7 +80,7 @@ in { (mkConnection "bekkalokk" "enp2s0") # (mkConnection "bicep" "enp6s0f0") # NOTE: physical machine is dead at the moment (mkConnection "buskerud" "eth1") - (mkConnection "knutsen" "eth1") + # (mkConnection "knutsen" "eth1") (mkConnection "powerpuff-cluster" "eth1") (mkConnection "lupine-1" "enp0s31f6") (mkConnection "lupine-2" "enp0s31f6") @@ -73,11 +89,13 @@ in { (mkConnection "lupine-5" "enp0s31f6") (mkConnection "innovation" "em0") (mkConnection "microbel" "eth0") - # (mkConnection "isvegg" "") + (mkConnection "isvegg" "eth0") (mkConnection "ameno" "eth0") (mkConnection "sleipner" "eno0") ]; - in builtins.listToAttrs ( + in + assert (lib.length connections' <= 15); + builtins.listToAttrs ( lib.zipListsWith (a: b: lib.nameValuePair a b) (lib.genList (i: "eth${toString (i + 1)}") 15) @@ -85,61 +103,86 @@ in { ); }; - nodes.knutsen = mkRouter "knutsen" { - interfaceGroups = [ ["eth1"] ["eth2"] ["vpn1"] ]; - connections.eth2 = mkConnectionRev "brus-switch" "eth6"; - # connections.vpn1 = mkConnection "ludvigsen" "vpn1"; - interfaces.vpn1.network = "site-vpn"; - interfaces.vpn1.virtual = true; - }; - nodes.buskerud = mkDevice "buskerud" { - interfaceGroups = [ ["eth1"] ]; + deviceIcon = ./icons/proxmox.svg; + interfaceGroups = [ [ "eth1" ] ]; + + interfaces.eth1.network = "pvv"; }; nodes.shark = { guestType = "proxmox"; parent = config.nodes.buskerud.id; + + interfaces.ens18.network = "pvv"; }; ### Powerpuff - nodes.powerpuff-cluster = mkDevice "powerpuff-cluster" { - interfaceGroups = [ ["eth1"] ]; + nodes.powerpuff-cluster = mkDevice "Powerpuff Cluster" { + deviceIcon = ./icons/proxmox.svg; + + hardware.info = "Dell PowerEdge R730 x 3"; + + interfaceGroups = [ [ "eth1" ] ]; }; nodes.kommode = { guestType = "proxmox"; parent = config.nodes.powerpuff-cluster.id; + + interfaces.ens18.network = "pvv"; }; nodes.bicep = { guestType = "proxmox"; parent = config.nodes.powerpuff-cluster.id; + + # hardware.info = "HP Proliant DL370G6"; + + interfaces.ens18.network = "pvv"; }; nodes.ustetind = { - guestType = "proxmox"; + guestType = "proxmox LXC"; parent = config.nodes.powerpuff-cluster.id; + + # TODO: the interface name is likely wrong + # interfaceGroups = [ [ "eth0" ] ]; + interfaces.eth0 = { + network = "pvv"; + # mac = ""; + addresses = [ + "129.241.210.234" + "2001:700:300:1900::234" + ]; + gateways = [ + values.hosts.gateway + values.hosts.gateway6 + ]; + }; }; ### PVV nodes.ntnu-veggen = mkRouter "NTNU-Veggen" { interfaceGroups = [ ["wan1"] ["eth1"] ]; - connections.eth1 = mkConnection "ludvigsen" "eth1"; + connections.eth1 = mkConnection "ludvigsen" "re0"; }; nodes.ludvigsen = mkRouter "ludvigsen" { - interfaceGroups = [ ["eth1"] ["eth2"] ["vpn1"] ]; - connections.eth2 = mkConnection "pvv-switch" "eth0"; + deviceIcon = "${pkgs.super-tiny-icons}/share/icons/SuperTinyIcons/svg/freebsd.svg"; + + interfaceGroups = [ [ "re0" ] [ "em0" ] [ "vpn1" ] ]; + + connections.em0 = mkConnection "pvv-switch" "eth0"; interfaces.vpn1.network = "site-vpn"; interfaces.vpn1.virtual = true; interfaces.vpn1.icon = "${pkgs.super-tiny-icons}/share/icons/SuperTinyIcons/svg/openvpn.svg"; - interfaces.eth1.network = "ntnu"; - interfaces.eth2.network = "pvv"; + interfaces.re0.network = "ntnu"; + interfaces.em0.network = "pvv"; }; nodes.pvv-switch = mkSwitch "PVV Switch (Terminalrommet)" { @@ -151,11 +194,15 @@ in { (mkConnection "wegonke" "enp4s0") (mkConnection "demiurgen" "eno1") (mkConnection "sanctuary" "ethernet_0") - # (mkConnection "torskas" "") - # (mkConnection "skrott" "") - # (mkConnection "principal" "") + (mkConnection "torskas" "eth0") + (mkConnection "skrott" "eth0") + (mkConnection "homeassistant" "eth0") + (mkConnection "orchid" "eth0") + (mkConnection "principal" "em0") ]; - in builtins.listToAttrs ( + in + assert (lib.length connections' <= 15); + builtins.listToAttrs ( lib.zipListsWith (a: b: lib.nameValuePair a b) (lib.genList (i: "eth${toString (i + 1)}") 15) @@ -167,19 +214,27 @@ in { ### Openstack nodes.stackit = mkDevice "stackit" { - interfaceGroups = [ ["*"] ]; + interfaceGroups = [ [ "*" ] ]; + + interfaces."*".network = "ntnu"; }; nodes.ildkule = { guestType = "openstack"; parent = config.nodes.stackit.id; + + interfaces.ens4.network = "ntnu"; }; nodes.wenche = { guestType = "openstack"; parent = config.nodes.stackit.id; + + interfaces.ens18.network = "pvv"; }; nodes.bakke = { guestType = "openstack"; parent = config.nodes.stackit.id; + + interfaces.enp2s0.network = "pvv"; }; } diff --git a/topology/icons/proxmox.svg b/topology/icons/proxmox.svg new file mode 100644 index 0000000..bf60bdf --- /dev/null +++ b/topology/icons/proxmox.svg @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/topology/non-nixos-machines.nix b/topology/non-nixos-machines.nix index 0da9140..15d2fbc 100644 --- a/topology/non-nixos-machines.nix +++ b/topology/non-nixos-machines.nix @@ -9,6 +9,7 @@ in { interfaceGroups = [ [ "ens18" ] ]; interfaces.ens18 = { + network = "pvv"; mac = "00:0c:29:de:05:0f"; addresses = [ "129.241.210.192" @@ -29,6 +30,7 @@ in { }; }; }; + nodes.tom = mkDevice "tom" { guestType = "proxmox"; parent = config.nodes.powerpuff-cluster.id; @@ -36,6 +38,7 @@ in { interfaceGroups = [ [ "ens18" ] ]; interfaces.ens18 = { + network = "pvv"; mac = "00:0c:29:4d:f7:56"; addresses = [ "129.241.210.180" @@ -55,6 +58,7 @@ in { }; }; }; + nodes.hildring = mkDevice "hildring" { guestType = "proxmox"; parent = config.nodes.powerpuff-cluster.id; @@ -63,6 +67,7 @@ in { interfaceGroups = [ [ "eth0" ] ]; interfaces.eth0 = { + network = "pvv"; mac = "00:0c:29:e7:dd:79"; addresses = [ "129.241.210.176" @@ -74,11 +79,28 @@ in { ]; }; }; + nodes.drolsum = mkDevice "drolsum" { guestType = "proxmox"; parent = config.nodes.powerpuff-cluster.id; deviceType = "loginbox"; deviceIcon = "${pkgs.super-tiny-icons}/share/icons/SuperTinyIcons/svg/debian.svg"; + + # TODO: the interface name is likely wrong + interfaceGroups = [ [ "eth0" ] ]; + interfaces.eth0 = { + network = "pvv"; + # mac = ""; + addresses = [ + "129.241.210.217" + "2001:700:300:1900::217" + "2001:700:300:1900::1:217" + ]; + gateways = [ + values.hosts.gateway + values.hosts.gateway6 + ]; + }; }; nodes.microbel = mkDevice "microbel" { @@ -99,6 +121,7 @@ in { ]; }; }; + nodes.innovation = mkDevice "innovation" { deviceIcon = "${pkgs.super-tiny-icons}/share/icons/SuperTinyIcons/svg/freebsd.svg"; @@ -125,11 +148,45 @@ in { }; }; }; + nodes.principal = mkDevice "principal" { deviceIcon = "${pkgs.super-tiny-icons}/share/icons/SuperTinyIcons/svg/freebsd.svg"; - interfaceGroups = [ [ ] ]; + # TODO: the interface name is likely wrong + interfaceGroups = [ [ "em0" ] ]; + interfaces.em0 = { + # mac = ""; + addresses = [ + "129.241.210.233" + "2001:700:300:1900::1:233" + ]; + gateways = [ + values.hosts.gateway + values.hosts.gateway6 + ]; + }; }; + + nodes.homeassistant = mkDevice "homeassistant" { + deviceIcon = "services.home-assistant"; + + hardware.info = "Raspberry Pi 4B"; + + # TODO: the interface name is likely wrong + interfaceGroups = [ [ "eth0" ] ]; + interfaces.eth0 = { + # mac = ""; + addresses = [ + "129.241.210.229" + "2001:700:300:1900::4:229" + ]; + gateways = [ + values.hosts.gateway + values.hosts.gateway6 + ]; + }; + }; + nodes.sleipner = mkDevice "sleipner" { deviceIcon = "${pkgs.super-tiny-icons}/share/icons/SuperTinyIcons/svg/debian.svg"; @@ -146,11 +203,25 @@ in { ]; }; }; + nodes.isvegg = mkDevice "isvegg" { deviceIcon = "${pkgs.super-tiny-icons}/share/icons/SuperTinyIcons/svg/debian.svg"; - interfaceGroups = [ [ ] ]; + # TODO: the interface name is likely wrong + interfaceGroups = [ [ "eth0" ] ]; + interfaces.eth0 = { + # mac = ""; + addresses = [ + "129.241.210.175" + "2001:700:300:1900::1:a" + ]; + gateways = [ + values.hosts.gateway + values.hosts.gateway6 + ]; + }; }; + nodes.ameno = mkDevice "ameno" { deviceIcon = "${pkgs.super-tiny-icons}/share/icons/SuperTinyIcons/svg/ubuntu.svg"; @@ -178,14 +249,42 @@ in { }; }; }; + nodes.skrott = mkDevice "skrott" { - interfaceGroups = [ [ ] ]; + # TODO: the interface name is likely wrong + interfaceGroups = [ [ "eth0" ] ]; + interfaces.eth0 = { + # mac = ""; + addresses = [ + "129.241.210.235" + ]; + gateways = [ + values.hosts.gateway + values.hosts.gateway6 + ]; + }; }; + nodes.torskas = mkDevice "torskas" { deviceIcon = "${pkgs.super-tiny-icons}/share/icons/SuperTinyIcons/svg/arch_linux.svg"; - interfaceGroups = [ [ ] ]; + hardware.info = "Raspberry pi 4B"; + + # TODO: the interface name is likely wrong + interfaceGroups = [ [ "eth0" ] ]; + interfaces.eth0 = { + # mac = ""; + addresses = [ + "129.241.210.241" + "2001:700:300:1900::241" + ]; + gateways = [ + values.hosts.gateway + values.hosts.gateway6 + ]; + }; }; + nodes.wegonke = mkDevice "wegonke" { deviceType = "terminal"; deviceIcon = "${pkgs.super-tiny-icons}/share/icons/SuperTinyIcons/svg/debian.svg"; @@ -205,6 +304,7 @@ in { ]; }; }; + nodes.demiurgen = mkDevice "demiurgen" { deviceType = "terminal"; deviceIcon = "${pkgs.super-tiny-icons}/share/icons/SuperTinyIcons/svg/debian.svg"; @@ -239,4 +339,24 @@ in { ]; }; }; + + nodes.orchid = mkDevice "orchid" { + deviceType = "terminal"; + deviceIcon = "${pkgs.super-tiny-icons}/share/icons/SuperTinyIcons/svg/debian.svg"; + + hardware.info = "Ryzen1600 Nvidia GTX 1060"; + + # TODO: the interface name is likely wrong + interfaceGroups = [ [ "eth0" ] ]; + interfaces.eth0 = { + addresses = [ + "129.241.210.210" + "2001:700:300:1900::210" + ]; + gateways = [ + values.hosts.gateway + values.hosts.gateway6 + ]; + }; + }; }