From 94dfc8c6a4521aaa54909496f2da92324e5efa58 Mon Sep 17 00:00:00 2001 From: Lzebulon Date: Sat, 24 Jan 2026 21:05:59 +0100 Subject: [PATCH] modif pour pouvoir generer la conf des switchs --- hosts.nix | 98 ++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 65 insertions(+), 33 deletions(-) diff --git a/hosts.nix b/hosts.nix index edef775..839e124 100644 --- a/hosts.nix +++ b/hosts.nix @@ -1,15 +1,47 @@ -let - adm = 10; - srv = ip: 4; - srv-nat = 2; - san = 3; - adh = ip: 42; -in -{ +rec { + vlans = { + srv = {id = 2;}; + srv-nat = {id = 3;}; + san = {id = 4;}; + adm = {id = 10;}; + adh = {id = 12;}; + adm-adh = {id = 13;}; + vr = {id = 27;}; + aurore = {id = 28;}; + imprimante = {id = 2756;}; + }; + + reseaux = { + aurore = { + vlans = with vlans; [ + aurore + ]; + switch = { + carapuce = 19; + }; + }; + # vr = { + # vlans = with vlans; [ + # vr + # ]; + # switch = { + # arceus = 21; + # }; + # }; + ens = { + vlans = with vlans; [ + imprimante + ]; + switch = { + carapuce = 17; + }; + }; + }; + physiques ={ thot = { id = 14; - vlans = [ + vlans = with vlans; [ adm ]; serveur_type = ["backup"]; @@ -21,7 +53,7 @@ in ft = { is_debian = true; id = 15; - vlans = [ + vlans = with vlans; [ adm ]; serveur_type = ["backup"]; @@ -41,7 +73,7 @@ in tealc = { is_debian = true; id = 1; - vlans = [ + vlans = with vlans; [ adm san ]; @@ -61,7 +93,7 @@ in cameron = { is_debian = true; id = 2; - vlans = [ + vlans = with vlans; [ adm san ]; @@ -73,7 +105,7 @@ in }; # cephirot = { # id = 3; - # vlans = [ + # vlans = with vlans; [ # adm # san # ]; @@ -87,7 +119,7 @@ in arceus = { is_debian = true; id = 7; - vlans = [ + vlans = with vlans; [ adm san ]; @@ -100,7 +132,7 @@ in carapuce = { is_debian = true; id = 8; - vlans = [ + vlans = with vlans; [ adm san ]; @@ -114,7 +146,7 @@ in sam = { is_debian = true; id = 11; - vlans = [ + vlans = with vlans; [ adm san srv-nat @@ -135,7 +167,7 @@ in daniel = { is_debian = true; id = 12; - vlans = [ + vlans = with vlans; [ adm san srv-nat @@ -156,7 +188,7 @@ in jack = { is_debian = true; id = 13; - vlans = [ + vlans = with vlans; [ adm san srv-nat @@ -178,7 +210,7 @@ in odlyd = { is_debian = true; id = 16; - vlans = [ + vlans = with vlans; [ adh adm ]; @@ -191,7 +223,7 @@ in stitch = { is_debian = true; id = 17; - vlans = [ + vlans = with vlans; [ adh adm ]; @@ -201,7 +233,7 @@ in ''; public-ssh = "ssh-rsa TODOTODOTODOTODOTODOTODOTODO"; }; - gulp = { + gulp = with vlans; { is_debian = true; id = 18; vlans = [ @@ -215,7 +247,7 @@ in public-ssh = "ssh-rsa TODOTODOTODOTODOTODOTODOTODO"; }; - zamok = { + zamok = with vlans; { is_debian = true; id = 31; vlans = [ @@ -236,7 +268,7 @@ in name = "romanesco"; is_debian = true; id = 145; - vlans = [ + vlans = with vlans; [ adm (adh "185.230.78.252") (srv "185.230.79.59") @@ -246,7 +278,7 @@ in ''; public-ssh = "ssh-rsa TODOTODOTODOTODOTODOTODOTODO"; }; - neo = { + neo = with vlans; { name = "neo"; id = 145; vlans = [ @@ -261,7 +293,7 @@ in }; nextcloud = { id = 146; - vlans = [ + vlans = with vlans; [ adm san srv-nat @@ -273,7 +305,7 @@ in }; apprentix = { id = 150; - vlans = [ + vlans = with vlans; [ adm ]; description = '' @@ -283,7 +315,7 @@ in }; jitsi = { id = 163; - vlans = [ + vlans = with vlans; [ adm (srv "185.230.79.15") ]; @@ -294,7 +326,7 @@ in }; livre = { id = 140; - vlans = [ + vlans = with vlans; [ adm srv-nat ]; @@ -305,7 +337,7 @@ in }; periodique = { id = 118; - vlans = [ + vlans = with vlans; [ adm srv-nat ]; @@ -316,7 +348,7 @@ in }; redite = { id = 139; - vlans = [ + vlans = with vlans; [ adm srv-nat ]; @@ -325,7 +357,7 @@ in ''; public-ssh = "ssh-rsa TODOTODOTODOTODOTODOTODOTODO"; }; - reverseproxy = { + reverseproxy = with vlans; { id = 151; vlans = [ adm @@ -339,7 +371,7 @@ in }; two = { id = 135; - vlans = [ + vlans = with vlans; [ adm srv-nat ]; @@ -350,7 +382,7 @@ in }; vaultwarden = { id = 159; - vlans = [ + vlans = with vlans; [ adm srv-nat ];