change wifi service

This commit is contained in:
mjallen18
2024-02-18 20:46:37 -06:00
parent eb749ab25e
commit f334aa74a4
2 changed files with 32 additions and 17 deletions

View File

@@ -148,6 +148,21 @@ in
];
};
systemd.services.fix-wifi = {
path = [ pkgs.bash ];
script = ''
sleep 5
if ping -q -c1 10.0.1.1 &>/dev/null; then
echo "No need to fix wifi"
else
echo 1 | tee /sys/bus/pci/devices/0000\:09\:00.0/reset
rmmod iwlwifi
modprobe iwlwifi
fi
'';
wantedBy = [ "multi-user.target" ];
};
# Networking configs
networking = {
hostName = hostname;