2023-06-19 22:45:01 +02:00
|
|
|
{ lib, config, ... }:
|
|
|
|
|
|
|
|
{
|
2023-09-23 17:55:26 +02:00
|
|
|
boot.resumeDevice = lib.optionalString ((lib.length config.swapDevices) > 0) (lib.head config.swapDevices).device;
|
2023-06-19 22:45:01 +02:00
|
|
|
services.logind = {
|
|
|
|
lidSwitch = "suspend-then-hibernate";
|
|
|
|
};
|
|
|
|
systemd.sleep.extraConfig = ''
|
|
|
|
HibernateDelaySec=30m
|
|
|
|
'';
|
2024-03-11 20:07:46 +01:00
|
|
|
|
2024-12-01 20:11:42 +01:00
|
|
|
services.upower = {
|
|
|
|
percentageLow = 20;
|
|
|
|
percentageCritical = 10;
|
|
|
|
percentageAction = 8;
|
|
|
|
};
|
|
|
|
|
2024-03-11 20:07:46 +01:00
|
|
|
programs.dconf.profiles = {
|
|
|
|
user.databases = [
|
|
|
|
{
|
|
|
|
settings = {
|
|
|
|
"org/gnome/settings-daemon/plugins/power" = {
|
2024-03-11 20:42:17 +01:00
|
|
|
power-button-action = "hibernate";
|
2024-03-11 20:07:46 +01:00
|
|
|
power-saver-profile-on-low-battery = false;
|
|
|
|
sleep-inactive-ac-type = "nothing";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
];
|
2024-03-11 20:28:28 +01:00
|
|
|
gdm.databases = [
|
|
|
|
{
|
|
|
|
settings = {
|
|
|
|
"org/gnome/settings-daemon/plugins/power" = {
|
2024-03-11 20:42:17 +01:00
|
|
|
power-button-action = "hibernate";
|
2024-03-11 20:28:28 +01:00
|
|
|
power-saver-profile-on-low-battery = false;
|
|
|
|
sleep-inactive-ac-type = "nothing";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
];
|
2024-03-11 20:07:46 +01:00
|
|
|
};
|
2023-06-19 22:45:01 +02:00
|
|
|
}
|