From a8ec5882de58038e7ee83f2959484114e5c8d464 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 26 Nov 2026 20:53:50 +0000 Subject: qi: give wpa_supplicant the wireless secrets as a credential wpa_supplicant runs as a user of its own, which can't read the secrets populate delivers (root's, mode 0600): "EXT PW FILE: could not open file '/var/src/secrets/wireless.secrets': Permission denied". systemd reads the file as root with LoadCredential, and wpa_supplicant reads its copy in the service's credentials directory, which the module binds into its root directory. --- systems/qi/base.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'systems') diff --git a/systems/qi/base.nix b/systems/qi/base.nix index cfaeed44..7c7335a5 100644 --- a/systems/qi/base.nix +++ b/systems/qi/base.nix @@ -29,8 +29,10 @@ networking.wireless = { userControlled.enable = true; enable = true; - # The keys are in the secrets file, as lines of NAME=KEY. - secretsFile = "${config.krebs.secret.directory}/wireless.secrets"; + # The keys are in the secrets file, as lines of NAME=KEY. wpa_supplicant + # runs as a user of its own, which can't read the secrets (root's, mode + # 0600), so it gets a copy as a credential, which systemd reads as root. + secretsFile = "/run/credentials/wpa_supplicant.service/wireless.secrets"; networks = { krebs.pskRaw = "ext:krebs"; Telefon.pskRaw = "ext:Telefon"; @@ -43,6 +45,9 @@ Pixel_1108.pskRaw = "ext:Pixel_1108"; }; }; + systemd.services.wpa_supplicant.serviceConfig.LoadCredential = [ + "wireless.secrets:${config.krebs.secret.directory}/wireless.secrets" + ]; zramSwap.enable = true; -- cgit v1.3.1