37 lines
905 B
Nix
37 lines
905 B
Nix
{ lib, config, ... }:
|
|
|
|
{
|
|
boot.resumeDevice = lib.optionalString ((lib.length config.swapDevices) > 0) (lib.head config.swapDevices).device;
|
|
services.logind = {
|
|
lidSwitch = "suspend-then-hibernate";
|
|
};
|
|
systemd.sleep.extraConfig = ''
|
|
HibernateDelaySec=30m
|
|
'';
|
|
|
|
programs.dconf.profiles = {
|
|
user.databases = [
|
|
{
|
|
settings = {
|
|
"org/gnome/settings-daemon/plugins/power" = {
|
|
power-button-action = "nothing";
|
|
power-saver-profile-on-low-battery = false;
|
|
sleep-inactive-ac-type = "nothing";
|
|
};
|
|
};
|
|
}
|
|
];
|
|
gdm.databases = [
|
|
{
|
|
settings = {
|
|
"org/gnome/settings-daemon/plugins/power" = {
|
|
power-button-action = "nothing";
|
|
power-saver-profile-on-low-battery = false;
|
|
sleep-inactive-ac-type = "nothing";
|
|
};
|
|
};
|
|
}
|
|
];
|
|
};
|
|
}
|