From c81594af019490a319262d1377188c5008150ada Mon Sep 17 00:00:00 2001 From: John Ogle Date: Tue, 30 Dec 2025 00:29:24 -0800 Subject: [PATCH] Add suspend-then-hibernate power management for nix-book --- machines/nix-book/configuration.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/machines/nix-book/configuration.nix b/machines/nix-book/configuration.nix index 65f86e1..dd07c54 100644 --- a/machines/nix-book/configuration.nix +++ b/machines/nix-book/configuration.nix @@ -39,6 +39,17 @@ boot.loader.efi.canTouchEfiVariables = true; boot.initrd.luks.devices."luks-b614167b-9045-4234-a441-ac6f60a96d81".device = "/dev/disk/by-uuid/b614167b-9045-4234-a441-ac6f60a96d81"; + + services.logind.settings.Login = { + HandleLidSwitch = "suspend-then-hibernate"; + HandlePowerKey = "hibernate"; + HandlePowerKeyLongPress = "poweroff"; + }; + systemd.sleep.extraConfig = '' + HibernateDelaySec=30m + SuspendState=mem + ''; + networking.hostName = "nix-book"; # Define your hostname. # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.