From 757386bd1129cb05c2830ae666fabf33978909ea Mon Sep 17 00:00:00 2001
From: Julien Malka <julien@malka.sh>
Date: Sat, 24 Aug 2024 01:03:39 +0200
Subject: [PATCH] feat: generalize simple network profile

---
 modules/meta/default.nix       | 5 +++++
 profiles/vm-simple-network.nix | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/modules/meta/default.nix b/modules/meta/default.nix
index 7e6b864..16d0fd5 100644
--- a/modules/meta/default.nix
+++ b/modules/meta/default.nix
@@ -38,6 +38,11 @@
               default = with profiles; [ base ];
             };
 
+            defaultInterface = mkOption {
+              description = "default interface of the machine";
+              default = "ens18";
+            };
+
           };
         }
       );
diff --git a/profiles/vm-simple-network.nix b/profiles/vm-simple-network.nix
index 43f0049..75943ab 100644
--- a/profiles/vm-simple-network.nix
+++ b/profiles/vm-simple-network.nix
@@ -2,7 +2,7 @@
 {
   systemd.network.enable = true;
   systemd.network.networks."10-wan" = {
-    matchConfig.Name = "ens18";
+    matchConfig.Name = config.machine.meta.defaultInterface;
     networkConfig = {
       DHCP = "ipv4";
       Address = config.machine.meta.ips.public.ipv6;