set up hibernate

This commit is contained in:
Rouven Seifert 2023-02-28 20:48:06 +01:00
parent d2b548cac2
commit 89604624c9
Signed by: rouven.seifert
GPG key ID: B95E8FE6B11C4D09
3 changed files with 25 additions and 8 deletions

View file

@ -25,13 +25,16 @@ A ThinkPad L15 that I use for almost everything that one needs a monitor to.
NAME MOUNTPOINT COMMENT NAME MOUNTPOINT COMMENT
nvme0n1 nvme0n1
├─nvme0n1p1 /boot ├─nvme0n1p1 /boot
└─nvme0n1p2 # LUKS-encrypted partition ├─nvme0n1p2 # LUKS-encrypted partition
└─luksroot # btrfs with some subvolumes │ └─luksroot # btrfs with some subvolumes
└─root / │ └─root /
└─home /home │ └─home /home
└─lib /var/lib │ └─lib /var/lib
└─log /var/log │ └─log /var/log
└─store /nix/store │ └─store /nix/store
└─nvme0n1p
└─luksswap # encrypted swap partition
``` ```
### nuc ### nuc

View file

@ -109,6 +109,15 @@
}; };
}; };
services.logind = {
lidSwitch = "suspend-then-hibernate";
lidSwitchDocked = "hybrid-sleep";
lidSwitchExternalPower = "suspend";
};
systemd.sleep.extraConfig = ''
HibernateDelaySec=1h
'';
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
wget wget
gcc gcc

View file

@ -18,6 +18,9 @@
device = "/dev/disk/by-uuid/6b89181c-71e0-4e84-8523-2456d3e28400"; device = "/dev/disk/by-uuid/6b89181c-71e0-4e84-8523-2456d3e28400";
allowDiscards = true; allowDiscards = true;
}; };
boot.initrd.luks.devices."luksswap" = {
device = "/dev/disk/by-uuid/4a5fd2d9-1b37-4895-a24b-835a9cd4063e";
};
fileSystems."/" = fileSystems."/" =
{ {
@ -61,7 +64,9 @@
fsType = "vfat"; fsType = "vfat";
}; };
swapDevices = [ ]; swapDevices =
[{ device = "/dev/disk/by-uuid/1dd20f07-877c-4ee5-bef5-5e8c6ebe7927"; }];
boot.resumeDevice = "/dev/disk/by-uuid/1dd20f07-877c-4ee5-bef5-5e8c6ebe7927";
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking # Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's # (the default) this is the recommended approach. When using systemd-networkd it's