From 876d01a5d85e1c15449f207207b53ae295db08b3 Mon Sep 17 00:00:00 2001 From: Rouven Seifert Date: Mon, 26 May 2025 16:26:27 +0200 Subject: [PATCH] generalize nspawn network config --- .../modules/virtualisation/default.nix | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/hosts/thinkpad/modules/virtualisation/default.nix b/hosts/thinkpad/modules/virtualisation/default.nix index 4ea4724..e7b022e 100644 --- a/hosts/thinkpad/modules/virtualisation/default.nix +++ b/hosts/thinkpad/modules/virtualisation/default.nix @@ -27,20 +27,26 @@ virt-viewer podman-compose ]; - systemd.nspawn = { - n1 = { + systemd.nspawn = + let networkConfig = { Private = true; VirtualEthernet = true; Bridge = "br0"; }; - }; - n2 = { - networkConfig = { - Private = true; - VirtualEthernet = true; - Bridge = "br0"; + in + { + n1 = { + inherit networkConfig; + }; + n2 = { + inherit networkConfig; + }; + evpn1 = { + inherit networkConfig; + }; + evpn2 = { + inherit networkConfig; }; }; - }; }