Add hibernate for laptop

This commit is contained in:
2026-02-25 01:14:42 +01:00
parent 84b57d81b5
commit 375ccff408
2 changed files with 16 additions and 0 deletions

View File

@@ -28,6 +28,7 @@
kernelModules = [ "kvm-intel" ];
extraModulePackages = [ ];
resumeDevice = "/dev/disk/by-uuid/bea07563-dc23-415b-b12f-ba53138bd492";
kernelParams = [
"snd_hda_intel.power_save=1"

View File

@@ -27,4 +27,19 @@
MEM_SLEEP_ON_BAT = "deep";
};
};
services.logind = {
# Use 'settings' for modern NixOS Unstable/Stable
settings = {
Login = {
HandleLidSwitch = "suspend-then-hibernate";
HandleLidSwitchExternalPower = "suspend";
HandleLidSwitchDocked = "ignore"; # Keeps external monitors alive
};
};
};
systemd.sleep.extraConfig = ''
HibernateDelaySec=10min
'';
}