nixos/test/wpa_supplicant: replace activation script by systemd service

See https://github.com/NixOS/nixpkgs/issues/475305
This commit is contained in:
r-vdp
2025-12-30 20:21:36 +02:00
parent 4e4c01ef8b
commit daa1cd8d14
+20 -9
View File
@@ -96,16 +96,27 @@ let
# Note: secrets are stored outside /etc/ and /nix/store to
# test for accessibility of these paths
system.activationScripts.wpa-secrets = {
deps = [
"users"
"specialfs"
systemd.services.wpa-secrets = {
wantedBy = [
"network.target"
"multi-user.target"
];
text = ''
install -Dm600 -o wpa_supplicant ${pkgs.writeText "wpa" ''
psk_nixos_test=${naughtyPassphrase}
''} /var/lib/secrets/wpa
'';
before = [
"network.target"
"multi-user.target"
];
serviceConfig = {
Type = "oneshot";
};
script =
let
secretFile = pkgs.writeText "wpa" ''
psk_nixos_test=${naughtyPassphrase}
'';
in
''
install -Dm600 -o wpa_supplicant ${secretFile} /var/lib/secrets/wpa
'';
};
# wireless client