polkit: Fix authenticating as a wheel user

In Javascript-based PolKit, "unix-user:0;unix-group:wheel" is not
valid; it should be a list "unix-user:0", "unix-group:wheel".
This commit is contained in:
Eelco Dolstra 2013-11-18 17:45:31 +01:00
parent 1ce709ee00
commit 7ea47df0a4

View File

@ -33,9 +33,9 @@ in
}; };
security.polkit.adminIdentities = mkOption { security.polkit.adminIdentities = mkOption {
type = types.str; type = types.listOf types.str;
default = "unix-user:0;unix-group:wheel"; default = [ "unix-user:0" "unix-group:wheel" ];
example = ""; example = [ "unix-user:alice" "unix-group:admin" ];
description = description =
'' ''
Specifies which users are considered administrators, for those Specifies which users are considered administrators, for those
@ -62,7 +62,7 @@ in
environment.etc."polkit-1/rules.d/10-nixos.rules".text = environment.etc."polkit-1/rules.d/10-nixos.rules".text =
'' ''
polkit.addAdminRule(function(action, subject) { polkit.addAdminRule(function(action, subject) {
return ["${cfg.adminIdentities}"]; return [${concatStringsSep ", " (map (i: "\"${i}\"") cfg.adminIdentities)}];
}); });
${cfg.extraConfig} ${cfg.extraConfig}