Compare commits
2 commits
3e07bd2b22
...
a0638fdff3
| Author | SHA1 | Date | |
|---|---|---|---|
| a0638fdff3 | |||
| 05948d31c2 |
2 changed files with 31 additions and 1 deletions
Binary file not shown.
|
|
@ -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;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue