Unverified Commit daa1cd8d authored by r-vdp's avatar r-vdp
Browse files

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

parent 4e4c01ef
Loading
Loading
Loading
Loading
+20 −9
Original line number Diff line number Diff line
@@ -96,15 +96,26 @@ 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" ''
          before = [
            "network.target"
            "multi-user.target"
          ];
          serviceConfig = {
            Type = "oneshot";
          };
          script =
            let
              secretFile = pkgs.writeText "wpa" ''
                psk_nixos_test=${naughtyPassphrase}
            ''} /var/lib/secrets/wpa
              '';
            in
            ''
              install -Dm600 -o wpa_supplicant ${secretFile} /var/lib/secrets/wpa
            '';
        };