diff options
| author | tv <tv@krebsco.de> | 2026-11-26 20:53:50 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-26 20:53:50 +0000 |
| commit | a8ec5882de58038e7ee83f2959484114e5c8d464 (patch) | |
| tree | d8ee8dfcad9d5b79594e7683568e768b44b21c94 | |
| parent | 2069656e0ccee88b79a17620ccd66082340a0ee7 (diff) | |
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.
| -rw-r--r-- | systems/qi/base.nix | 9 |
1 files changed, 7 insertions, 2 deletions
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; |
