From de3bc903efc802d85b3252b09cc4d9b116170f17 Mon Sep 17 00:00:00 2001
From: clerie <git@clerie.de>
Date: Thu, 20 Mar 2025 20:03:39 +0100
Subject: [PATCH] profiles/common-networking: Centralize new network config

---
 profiles/common-networking/default.nix | 24 ++++++++++++++++++++++++
 profiles/default.nix                   |  1 +
 2 files changed, 25 insertions(+)
 create mode 100644 profiles/common-networking/default.nix

diff --git a/profiles/common-networking/default.nix b/profiles/common-networking/default.nix
new file mode 100644
index 0000000..4a3b3b5
--- /dev/null
+++ b/profiles/common-networking/default.nix
@@ -0,0 +1,24 @@
+{ config, lib, ... }:
+
+with lib;
+
+{
+
+  options.profiles.clerie.common-networking = {
+    enable = mkEnableOption "Common networking config";
+  };
+
+  config = mkIf config.profiles.clerie.common-networking.enable {
+
+    # Disable scripted network
+    networking.useDHCP = false;
+    # Enable systemd-networkd
+    systemd.network.enable = true;
+
+    # Don't wait for online, if NetworkManger is running too
+    systemd.network.wait-online = mkIf (config.networking.networkmanager.enable == true) {
+      enable = false;
+    };
+
+  };
+}
diff --git a/profiles/default.nix b/profiles/default.nix
index 3daf86a..56cb944 100644
--- a/profiles/default.nix
+++ b/profiles/default.nix
@@ -3,6 +3,7 @@
 {
 
   imports = [
+    ./common-networking
     ./cybercluster-vm
     ./fem-net
     ./hetzner-cloud