diff --git a/laptop/hardware-configuration.nix b/laptop/hardware-configuration.nix index 3455fe0..5cd17d6 100644 --- a/laptop/hardware-configuration.nix +++ b/laptop/hardware-configuration.nix @@ -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" diff --git a/laptop/modules/services.nix b/laptop/modules/services.nix index 6c0f2a2..fc517dc 100644 --- a/laptop/modules/services.nix +++ b/laptop/modules/services.nix @@ -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 + ''; }