Commit 52888a16b511

Vincent Demeester <vincent@sbr.pm>
2017-05-12 10:15:47
Update polkit security (fixes problems with udiskie)
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent a342289
Changed files (1)
profiles
profiles/desktop.nix
@@ -127,6 +127,18 @@ ${pkgs.pythonPackages.udiskie}/bin/udiskie -a -t -n -F &
 			font-droid
 		];
 	};
+
+	# Polkit.
+	security.polkit.extraConfig = ''
+	polkit.addRule(function(action, subject) {
+		if ((action.id == "org.freedesktop.udisks2.filesystem-mount-system" ||
+		action.id == "org.freedesktop.udisks2.encrypted-unlock-system"
+		) &&
+		subject.local && subject.active && subject.isInGroup("users")) {
+			return polkit.Result.YES;
+		}
+	});
+	'';
 	# Auto commit some repositories
 	systemd.user.services.ggasy = {
 		description = "Auto commit some git annex repository";