From 11977d1b5df124392cba59ea13123ab4cc11158f Mon Sep 17 00:00:00 2001 From: SebastianStork Date: Wed, 26 Jun 2024 21:50:50 +0200 Subject: [PATCH] Simplify template --- modules/system/wlan.nix | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/modules/system/wlan.nix b/modules/system/wlan.nix index 5635728..8178d8e 100644 --- a/modules/system/wlan.nix +++ b/modules/system/wlan.nix @@ -16,14 +16,14 @@ templates = let - mkPskFile = key: '' + makePskFile = name: '' [Security] - Passphrase=${key} + Passphrase=${config.sops.placeholder."wlan/${name}/key"} ''; in { - "iwd/WLAN-233151.psk".content = mkPskFile "${config.sops.placeholder."wlan/WLAN-233151/key"}"; - "iwd/Fairphone4.psk".content = mkPskFile "${config.sops.placeholder."wlan/Fairphone4/key"}"; + "iwd/WLAN-233151.psk".content = makePskFile "WLAN-233151"; + "iwd/Fairphone4.psk".content = makePskFile "Fairphone4"; }; }; @@ -38,7 +38,9 @@ }; systemd.tmpfiles.rules = [ - "C /var/lib/iwd/WLAN-233151.psk 0600 root root - ${config.sops.templates."iwd/WLAN-233151.psk".path}" + "C /var/lib/iwd/WLAN-233151.psk 0600 root root - ${ + config.sops.templates."iwd/WLAN-233151.psk".path + }" "C /var/lib/iwd/Fairphone4.psk 0600 root root - ${config.sops.templates."iwd/Fairphone4.psk".path}" ];