From aad0072dbbce958a57141982ec1434fbbc00cbb1 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 30 Apr 2025 23:51:42 +0200 Subject: [PATCH] buildMozillaMach: disable geoclue when geolocation support is disabled This was an oversight since support for geoclue was added in Firefox 102. --- .../networking/browsers/firefox/common.nix | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/pkgs/applications/networking/browsers/firefox/common.nix b/pkgs/applications/networking/browsers/firefox/common.nix index 5eb37f04dce6..56b13edbbee3 100644 --- a/pkgs/applications/networking/browsers/firefox/common.nix +++ b/pkgs/applications/networking/browsers/firefox/common.nix @@ -248,12 +248,21 @@ let } ); - defaultPrefs = lib.optionalAttrs geolocationSupport { - "geo.provider.network.url" = { - value = "https://api.beacondb.net/v1/geolocate"; - reason = "We have no Google API keys and Mozilla Location Services were retired."; - }; - }; + defaultPrefs = + if geolocationSupport then + { + "geo.provider.network.url" = { + value = "https://api.beacondb.net/v1/geolocate"; + reason = "We have no Google API keys and Mozilla Location Services were retired."; + }; + } + else + { + "geo.provider.use_geoclue" = { + value = false; + reason = "Geolocation support has been disabled through the `geolocationSupport` package attribute."; + }; + }; defaultPrefsFile = pkgs.writeText "nixos-default-prefs.js" ( lib.concatStringsSep "\n" (