security.polkit.extraConfig
NixOS option
Any polkit rules to be added to config (in JavaScript ;-). See: https://www.freedesktop.org/software/polkit/docs/latest/polkit.8.html#polkit-rules
type: strings concatenated with "\n"Default
""
Example
declared in: nixos/modules/security/polkit.nixView source on NixOS/nixpkgs →''
/* Log authorization checks. */
polkit.addRule(function(action, subject) {
// Make sure to negate --no-debug in services.polkit.extraArgs: { security.polkit.extraArgs = [ "--log-level=notice" ]; }
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";
});
''