Compare commits

...

2 commits

Author SHA1 Message Date
1f24d8a001 Add polkit 2024-04-29 23:09:23 -04:00
5ebb95135a Allow automatic reboots
Only between 2 and 6 am
2024-04-29 23:09:23 -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;