From 6be0aa50647df2d22635973a88813cec3193b8a2 Mon Sep 17 00:00:00 2001 From: SebastianStork Date: Wed, 22 Oct 2025 12:56:31 +0200 Subject: [PATCH] wlan: Cleanup previous network files after iwd stops instead of before it starts --- modules/system/services/wlan.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/system/services/wlan.nix b/modules/system/services/wlan.nix index 60130ca..0936653 100644 --- a/modules/system/services/wlan.nix +++ b/modules/system/services/wlan.nix @@ -35,9 +35,9 @@ in restartUnits = [ "iwd.service" ]; }); - systemd.services.iwd.preStart = '' - rm --force /var/lib/iwd/*.{psk,8021x} - install -m 600 /run/secrets/iwd/* /var/lib/iwd - ''; + systemd.services.iwd = { + preStart = "install -m 600 /run/secrets/iwd/* /var/lib/iwd"; + postStop = "rm --force /var/lib/iwd/*.{psk,8021x}"; + }; }; }