From 1ce709ee005a3310b7fab8ee4b5de824474252bf Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 18 Nov 2013 17:33:20 +0100 Subject: [PATCH] polkit: The rule file needs to end in .rules Otherwise it's ignored. --- nixos/modules/security/polkit.nix | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/nixos/modules/security/polkit.nix b/nixos/modules/security/polkit.nix index 940e87e0b02..614e10cd8f3 100644 --- a/nixos/modules/security/polkit.nix +++ b/nixos/modules/security/polkit.nix @@ -58,18 +58,15 @@ in # The polkit daemon reads action/rule files environment.pathsToLink = [ "/share/polkit-1" ]; - # PolKit rules for NixOS - environment.etc = [ { - source = pkgs.writeText "10-nixos.conf" - '' - polkit.addAdminRule(function(action, subject) { - return ["${cfg.adminIdentities}"]; - }); + # PolKit rules for NixOS. + environment.etc."polkit-1/rules.d/10-nixos.rules".text = + '' + polkit.addAdminRule(function(action, subject) { + return ["${cfg.adminIdentities}"]; + }); - ${cfg.extraConfig} - ''; #TODO: validation on compilation (at least against typos) - target = "polkit-1/rules.d/10-nixos.conf"; - } ]; + ${cfg.extraConfig} + ''; #TODO: validation on compilation (at least against typos) services.dbus.packages = [ pkgs.polkit ];