nixos/test/wpa_supplicant: replace activation script by systemd service (#475366)

This commit is contained in:
Michele Guerini Rocco
2025-12-31 00:01:56 +00:00
committed by GitHub
+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