nixos_dots/modules/nixos/hibernate.nix

21 lines
876 B
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Тут будет настройка гибернации в файл подкачки
# Файл подкачки создан в /etc/nixos/hardware-configuration.nix
# Проверить установлен ли сейчас resume: cat /sys/power/resume
# Если 0:0, то ничего не указано
# Узнать uuid файла подкачки:
# lsblk `df /swapfile | awk '/^\/dev/ {print $1}'` -no UUID
# Узнать offset файла подкачки:
# sudo filefrag -v /swapfile | awk '$1=="0:" {print substr($4, 1, length($4)-2)}'
{
boot = {
resumeDevice = "/dev/disk/by-uuid/efaee29f-06a9-4486-b1ef-675d3d06c350";
kernelParams = [ "resume_offset=11440128" ];
};
# Не знаю надо ли это. На виртуалке я не могу забутиться в любом случае
# boot.initrd.systemd.enable = true;
}