1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 10:11:08 +01:00

feat(polkit): dont need password for systemctl

This commit is contained in:
2022-02-02 18:07:08 +01:00
parent f1ed00fe40
commit 894cc6efef
2 changed files with 14 additions and 0 deletions

13
configs/polkit.nix Normal file
View File

@@ -0,0 +1,13 @@
{ config, ... }:
let
user = config.users.users.me.name;
in
{
security.polkit.extraConfig = ''
polkit.addRule(function(action, subject) {
if (subject.user == "${user}" && action.id == "org.freedesktop.systemd1.manage-units") {
return polkit.Result.YES;
}
});
'';
}