gnome: attempt to prevent device from sleeping

This commit is contained in:
John Bowdre 2023-09-25 08:52:35 -05:00
parent ff1b0622d1
commit 9794125f0a

View file

@ -1,13 +1,35 @@
{ {
services.xserver = { services = {
enable = true; xserver = {
displayManager = { enable = true;
gdm.enable = true; displayManager = {
gdm = {
enable = true;
autoSuspend = false;
};
desktopManager = {
gnome.enable = true;
};
layout = "us";
xkbVariant = "";
}; };
desktopManager = { logind.lidSwitch = "ignore";
gnome.enable = true; };
}; security.polkit.extraConfig = ''
layout = "us"; polkit.addRule(function(action, subject) {
xkbVariant = ""; if (action.id == "org.freedesktop.login1.suspend" ||
action.id == "org.freedesktop.login1.suspend-multiple-sessions" ||
action.id == "org.freedesktop.login1.hibernate" ||
action.id == "org.freedesktop.login1.hibernate-multiple-sessions")
{
return polkit.Result.NO;
}
});
'';
systemd.targets = {
sleep.enable = false;
suspend.enable = false;
hibernate.enable = false;
hybrid-sleep.enable = false;
}; };
} }