fix suspend!

This commit is contained in:
Reid 2025-12-10 21:59:55 -08:00
parent 08f5805f1c
commit d2c5931131
Signed by: reidlab
GPG key ID: DAF5EAF6665839FD

View file

@ -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"];
};
}