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:
@@ -228,6 +228,7 @@ in {
|
|||||||
./flameshot-once.nix
|
./flameshot-once.nix
|
||||||
./packages.nix
|
./packages.nix
|
||||||
./stardict.nix
|
./stardict.nix
|
||||||
|
./polkit.nix
|
||||||
./power-action.nix
|
./power-action.nix
|
||||||
./printing.nix
|
./printing.nix
|
||||||
./openweathermap.nix
|
./openweathermap.nix
|
||||||
|
|||||||
13
configs/polkit.nix
Normal file
13
configs/polkit.nix
Normal 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;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
'';
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user