Compare commits

...

2 commits

Author SHA1 Message Date
73f9033023 Add polkit 2024-04-29 23:04:23 -04:00
fa97e16c8e Allow automatic reboots
Only between 2 and 6 am
2024-04-29 20:43:12 -04:00
2 changed files with 21 additions and 0 deletions

View file

@ -15,5 +15,7 @@
system.autoUpgrade = { system.autoUpgrade = {
enable = true; enable = true;
flake = "git+https://git.icanttype.org/cdombroski/nix-configs.git"; flake = "git+https://git.icanttype.org/cdombroski/nix-configs.git";
allowReboot = true;
rebootWindow = { lower = "02:00"; upper = "06:00" };
}; };
} }

View file

@ -98,6 +98,25 @@
security = { security = {
rtkit.enable = true; rtkit.enable = true;
polkit = {
enable = true;
extraConfig = ''
polkit.addRule(function(action, subject) {
if (
subject.isInGroup("users")
&& (
action.id == "org.freedesktop.login1.reboot" ||
action.id == "org.freedesktop.login1.reboot-multiple-sessions" ||
action.id == "org.freedesktop.login1.power-off" ||
action.id == "org.freedesktop.login1.power-off-multiple-sessions"
)
)
{
return polkit.Result.YES;
}
})
'';
};
}; };
users.users.cdombroski = { users.users.cdombroski = {
isNormalUser = true; isNormalUser = true;