Compare commits

..

2 commits

Author SHA1 Message Date
a0638fdff3 Updated permissions 2025-09-30 16:49:52 +00:00
05948d31c2 Updated secrets 2025-09-23 08:10:26 +00:00
2 changed files with 31 additions and 1 deletions

Binary file not shown.

View file

@ -76,7 +76,37 @@ in {
users.groups.${userGroup} = {}; users.groups.${userGroup} = {};
users.users.${userGroup} = { users.users.${userGroup} = {
group = userGroup; group = userGroup;
isSystemUser = true; isNormalUser = true;
home = "/home/${userGroup}";
}; };
security.polkit.extraConfig = ''
polkit.addRule(function(action, subject) {
polkit.log("Rule triggered. Action: " + action.id + " Unit: " + action.lookup("unit") + " User: " + subject.user);
// For journalctl access
if ((action.id == "org.freedesktop.systemd1.manage-units" ||
action.id == "org.freedesktop.systemd1.unit-journal") &&
action.lookup("unit") == "${userGroup}.service" &&
subject.user == "${userGroup}") {
polkit.log("ALLOWING access for " + subject.user);
return polkit.Result.YES;
}
});
polkit.addRule(function(action, subject) {
if (
subject.user == "${userGroup}" &&
(
action.id == "org.freedesktop.login1.power-off" ||
action.id == "org.freedesktop.login1.power-off-ignore-inhibit" ||
action.id == "org.freedesktop.login1.power-off-multiple-sessions" ||
action.id == "org.freedesktop.login1.reboot" ||
action.id == "org.freedesktop.login1.reboot-ignore-inhibit" ||
action.id == "org.freedesktop.login1.reboot-multiple-sessions"
)
) {
return polkit.Result.NO;
}
});
'';
}; };
} }