mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2026-04-15 05:39:11 +02:00
wip: migrate client modules
This commit is contained in:
parent
f6d2ff1544
commit
7ce27d5d2f
245 changed files with 20254 additions and 188 deletions
30
modules-clone/nixos/optional/hibernation.nix
Normal file
30
modules-clone/nixos/optional/hibernation.nix
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
{ lib, config, ... }:
|
||||
{
|
||||
options.swarselsystems = {
|
||||
hibernation = {
|
||||
offset = lib.mkOption {
|
||||
type = lib.types.int;
|
||||
default = 0;
|
||||
};
|
||||
resumeDevice = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "/dev/disk/by-label/nixos";
|
||||
};
|
||||
};
|
||||
};
|
||||
config = {
|
||||
boot = {
|
||||
kernelParams = [
|
||||
"resume_offset=${builtins.toString config.swarselsystems.hibernation.offset}"
|
||||
# "mem_sleep_default=deep"
|
||||
];
|
||||
inherit (config.swarselsystems.hibernation) resumeDevice;
|
||||
};
|
||||
systemd.services."systemd-suspend-then-hibernate".aliases = [ "systemd-suspend.service" ];
|
||||
powerManagement.enable = true;
|
||||
systemd.sleep.settings.Sleep = {
|
||||
HibernateDelaySec = "120m";
|
||||
SuspendState = "freeze";
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue