This commit is contained in:
2026-03-25 19:47:00 +00:00
parent 20ffd3307c
commit a381c4886a
@@ -14,19 +14,17 @@
{ {
# My laptop doesn't like having connectivity when it goes to sleep, it burns through battery # My laptop doesn't like having connectivity when it goes to sleep, it burns through battery
systemd.services.sleep-rfkill = { systemd.services.sleep-rfkill = {
enable = true; description = "Custom suspend/resume hook";
DefaultDependencies = false; wantedBy = [ "sleep.target" ];
StopWhenUnneeded = true;
description = "";
before = [ "sleep.target" ]; before = [ "sleep.target" ];
serviceConfig = { serviceConfig = {
Type = "oneshot"; Type = "oneshot";
ExecStart = "${sleep-rfkill}"; # Command to run BEFORE system suspends
ExecStop = "${wake-rfkill}"; ExecStart = "${pkgs.util-linux}/bin/rfkill block all";
# Command to run AFTER system resumes
ExecStop = "${pkgs.util-linux}/bin/rfkill unblock all";
RemainAfterExit = true; RemainAfterExit = true;
}; };
wantedBy = [ "sleep.target" ];
}; };
}; };
}; };