diff --git a/hosts/goopnet-interface/apple-macbook-air-9-1.nix b/hosts/goopnet-interface/apple-macbook-air-9-1.nix index e4bf759..8ae4e3b 100644 --- a/hosts/goopnet-interface/apple-macbook-air-9-1.nix +++ b/hosts/goopnet-interface/apple-macbook-air-9-1.nix @@ -29,4 +29,33 @@ "i915.enable_fbc=1" "i915.enable_gvt=1" ]; + + # fix sleep/suspend + # ty https://github.com/3ulalia/flake/blob/aaddbef19979c6d952f7a763cd9e6225d6330a02/hosts/catalina/default.nix + systemd.services."suspend-fix-t2" = { + enable = true; + unitConfig = { + Description = "Disable and Re-Enable Apple BCE Module (and Wi-Fi)"; + Before = "sleep.target"; + StopWhenUnneeded = "yes"; + }; + serviceConfig = { + User = "root"; + Type = "oneshot"; + RemainAfterExit = "yes"; + ExecStart = [ + "/run/current-system/sw/bin/modprobe -r brcmfmac_wcc" + "/run/current-system/sw/bin/modprobe -r brcmfmac" + "/run/current-system/sw/bin/modprobe -r hci_bcm4377" + "/run/current-system/sw/bin/rmmod -f apple-bce" + ]; + ExecStop = [ + "/run/current-system/sw/bin/modprobe apple-bce" + "/run/current-system/sw/bin/modprobe hci_bcm4377" + "/run/current-system/sw/bin/modprobe brcmfmac" + "/run/current-system/sw/bin/modprobe brmcfmac_wcc" + ]; + }; + wantedBy = ["sleep.target"]; + }; }