wifi: Fix wifi_apply failing on boot

This commit is contained in:
Geoffrey Frogeye 2024-06-17 15:23:25 +02:00
parent 28ab3b0665
commit 6570e71eca
Signed by: geoffrey
GPG key ID: C72403E7F82E6AD8
3 changed files with 7 additions and 1 deletions

View file

@ -13,6 +13,7 @@
nixos_flake="$(readlink -f /etc/nixos)" nixos_flake="$(readlink -f /etc/nixos)"
if [ -f "$nixos_flake/flake.nix" ] if [ -f "$nixos_flake/flake.nix" ]
then then
# TODO For extensions this only works on systems where the flake has been resolved
nix run "$nixos_flake#updateLocalFlakes" -- "$nixos_flake" nix run "$nixos_flake#updateLocalFlakes" -- "$nixos_flake"
nix run "$nixos_flake#nixosRebuild" -- "$verb" "$@" nix run "$nixos_flake#nixosRebuild" -- "$verb" "$@"
fi fi

View file

@ -1,4 +1,6 @@
""" """
Add the networks saved in wireless_networks to wpa_supplicant,
without restarting it or touching its config file.
""" """
import json import json

View file

@ -70,6 +70,9 @@ in
after = [ "wpa_supplicant.service" ]; after = [ "wpa_supplicant.service" ];
wantedBy = [ "wpa_supplicant.service" ]; wantedBy = [ "wpa_supplicant.service" ];
path = with pkgs; [ wpa_supplicant ]; path = with pkgs; [ wpa_supplicant ];
script = "${applyScript}"; script = ''
for i in {1..10}; do wpa_cli status &> /dev/null && break; done
${applyScript}
'';
}; };
} }