From effb386e518ed79fd34f7a81892cd26f88564613 Mon Sep 17 00:00:00 2001
From: clerie <git@clerie.de>
Date: Thu, 20 Mar 2025 19:30:10 +0100
Subject: [PATCH] profiles/wg-clerie: Only configure sops secret if we want to
 use that

---
 profiles/wg-clerie/default.nix | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/profiles/wg-clerie/default.nix b/profiles/wg-clerie/default.nix
index b6a6bf7..a845187 100644
--- a/profiles/wg-clerie/default.nix
+++ b/profiles/wg-clerie/default.nix
@@ -40,10 +40,12 @@ in
     };
     systemd.network.config.addRouteTablesToIPRoute2 = true;
 
-    sops.secrets.wg-clerie = {
-      owner = "systemd-network";
-      group = "systemd-network";
-    };
+    sops = (mkIf (cfg.privateKeyFile == null) {
+      secrets.wg-clerie = {
+        owner = "systemd-network";
+        group = "systemd-network";
+      };
+    });
 
     systemd.network.netdevs."10-wg-clerie" = {
       netdevConfig = {