hibernate maybe

This commit is contained in:
2026-04-11 15:04:10 -04:00
parent c54bf86f7f
commit 68f4726bcf

View File

@@ -30,6 +30,7 @@
device = "/dev/disk/by-uuid/d9fee0ac-b35f-4d21-9461-3497af72d8bd"; device = "/dev/disk/by-uuid/d9fee0ac-b35f-4d21-9461-3497af72d8bd";
fsType = "ext4"; fsType = "ext4";
}; };
boot.resumeDevice = "/dev/disk/by-uuid/d9fee0ac-b35f-4d21-9461-3497af72d8bd";
fileSystems."/boot" = { fileSystems."/boot" = {
device = "/dev/disk/by-uuid/299C-03A0"; device = "/dev/disk/by-uuid/299C-03A0";
@@ -47,6 +48,25 @@
} }
]; ];
services.power-profiles-daemon.enable = true;
# Suspend first then hibernate when closing the lid
services.logind.settings.Login.LidSwitch = "suspend-then-hibernate";
# Hibernate on power button pressed
services.logind.settings.Login.PowerKey = "hibernate";
services.logind.settings.Login.PowerKeyLongPress = "poweroff";
# Suspend first
boot.kernelParams = [
"mem_sleep_default=deep"
"resume_offset=62050304"
];
# Define time delay for hibernation
systemd.sleep.extraConfig = ''
HibernateDelaySec=15m
SuspendState=mem
'';
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
} }