From 4fa107f1c9bcf0af6eaea23e30f37c69296ff7bc Mon Sep 17 00:00:00 2001 From: rnhmjoj Date: Sun, 21 Apr 2024 02:05:12 +0200 Subject: 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. --- nixos/modules/services/networking/wpa_supplicant.nix | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'nixos/modules') diff --git a/nixos/modules/services/networking/wpa_supplicant.nix b/nixos/modules/services/networking/wpa_supplicant.nix index c9dd1d1b0f01f..2804e3ecf1770 100644 --- a/nixos/modules/services/networking/wpa_supplicant.nix +++ b/nixos/modules/services/networking/wpa_supplicant.nix @@ -124,6 +124,11 @@ let fi ''} + # ensure wpa_supplicant.conf exists, or the daemon will fail to start + ${optionalString cfg.allowAuxiliaryImperativeNetworks '' + touch /etc/wpa_supplicant.conf + ''} + # substitute environment variables if [ -f "${configFile}" ]; then ${pkgs.gawk}/bin/awk '{ -- cgit 1.4.1