polkit: The rule file needs to end in .rules

Otherwise it's ignored.
This commit is contained in:
Eelco Dolstra 2013-11-18 17:33:20 +01:00
parent 678bcc6d4d
commit 1ce709ee00

View File

@ -58,18 +58,15 @@ in
# The polkit daemon reads action/rule files # The polkit daemon reads action/rule files
environment.pathsToLink = [ "/share/polkit-1" ]; environment.pathsToLink = [ "/share/polkit-1" ];
# PolKit rules for NixOS # PolKit rules for NixOS.
environment.etc = [ { environment.etc."polkit-1/rules.d/10-nixos.rules".text =
source = pkgs.writeText "10-nixos.conf" ''
'' polkit.addAdminRule(function(action, subject) {
polkit.addAdminRule(function(action, subject) { return ["${cfg.adminIdentities}"];
return ["${cfg.adminIdentities}"]; });
});
${cfg.extraConfig} ${cfg.extraConfig}
''; #TODO: validation on compilation (at least against typos) ''; #TODO: validation on compilation (at least against typos)
target = "polkit-1/rules.d/10-nixos.conf";
} ];
services.dbus.packages = [ pkgs.polkit ]; services.dbus.packages = [ pkgs.polkit ];