diff --git a/hosts/by-name/servo/users/shelvacu.nix b/hosts/by-name/servo/users/shelvacu.nix index 7181c2b15..03e546ef2 100644 --- a/hosts/by-name/servo/users/shelvacu.nix +++ b/hosts/by-name/servo/users/shelvacu.nix @@ -37,6 +37,28 @@ } ]; + security.polkit.extraConfig = '' + // allow: + // - systemctl restart|start|stop SERVICE + polkit.addRule(function(action, subject) { + if (subject.user == "shelvacu" && action.id == "org.freedesktop.systemd1.manage-units") { + switch (action.lookup("verb")) { + // case "cancel": + // case "reenable": + case "restart": + // case "reload": + // case "reload-or-restart": + case "start": + case "stop": + // case "try-reload-or-restart": + // case "try-restart": + return polkit.Result.YES; + default: + } + } + }) + ''; + sane.persist.sys.byStore.private = [ { path = "/home/shelvacu/persist"; user = "shelvacu"; group = "users"; mode = "0700"; } ];