summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--nixos/modules/security/polkit.nix10
1 files changed, 9 insertions, 1 deletions
diff --git a/nixos/modules/security/polkit.nix b/nixos/modules/security/polkit.nix
index e81a4d95f05c..dbec4ad98d16 100644
--- a/nixos/modules/security/polkit.nix
+++ b/nixos/modules/security/polkit.nix
@@ -23,7 +23,15 @@ in
       default = "";
       example =
         ''
-          TODO
+          /* Log authorization checks. */
+          polkit.addRule(function(action, subject) {
+            polkit.log("user " +  subject.user + " is attempting action " + action.id + " from PID " + subject.pid);
+          });
+
+          /* Allow any local user to do anything (dangerous!). */
+          polkit.addRule(function(action, subject) {
+            if (subject.local) return "yes";
+          });
         '';
       description =
         ''