topology: add a bunch of non-nixos machines

This commit is contained in:
h7x4
2025-12-30 02:53:39 +09:00
parent 197433a4c3
commit ad61336a20
2 changed files with 105 additions and 11 deletions

View File

@@ -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" {

View File

@@ -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 = [ [ ] ];
};
}