nixos/wireless: create empty config for imperative setup

If allowAuxiliaryImperativeNetworks is enabled, the wpa_supplicant
daemon complains fails to start if /etc/wpa_supplicant.conf does not
exist. As this can be created using wpa_cli (or similar) later, it
shouldn't matter, so let's create an empty one.

This fixes issues #157537, #299466.
This commit is contained in:
rnhmjoj 2024-04-21 02:05:12 +02:00
parent e5e8e0688f
commit 4fa107f1c9
No known key found for this signature in database
GPG key ID: BFBAF4C975F76450

View file

@ -124,6 +124,11 @@ let
fi fi
''} ''}
# ensure wpa_supplicant.conf exists, or the daemon will fail to start
${optionalString cfg.allowAuxiliaryImperativeNetworks ''
touch /etc/wpa_supplicant.conf
''}
# substitute environment variables # substitute environment variables
if [ -f "${configFile}" ]; then if [ -f "${configFile}" ]; then
${pkgs.gawk}/bin/awk '{ ${pkgs.gawk}/bin/awk '{