this post was submitted on 21 Jul 2025
7 points (88.9% liked)

Nix / NixOS

2356 readers
19 users here now

Main links

Videos

founded 2 years ago
MODERATORS
 

Hi, new NixOS user here.

Liking it so far but just hit an issue that I'm having trouble getting past. Pages in firefox cannot access my geolocation, even after I hit allow when the page asks for permission. Same with the default Gnome maps app, it just places me in a central location of my countrys capital (I don't live in the capital).

I've added the following to my configuration.nix file and rebuilt but it made no difference.

 # Geolocation
  services.geoclue2.enable = true;

  environment.sessionVariables = {
    # Allows geolocation in firefox
    MOZ_ENABLE_WAYLAND = "1"; 
  };

What am I missing?

you are viewing a single comment's thread
view the rest of the comments
[–] hyveltjuven@lemmy.world 2 points 6 days ago (5 children)

No gps modem but geolocation works on my other computer running fedora which also doesn't have gps.

[–] balsoft@lemmy.ml 1 points 6 days ago* (last edited 6 days ago) (4 children)

Hm, interesting. The other user said that geoclue tries using beacondb (I didn't know that :D).

Can you try running this: $(nix-build '<nixpkgs>' -A geoclue2)/libexec/geoclue-2.0/demos/where-am-i ? It should print out your location according to geoclue, and the source which it has used.

For me, it looks like this:

❯ $(nix-build '<nixpkgs>' -A geoclue2)/libexec/geoclue-2.0/demos/where-am-i
Client object: /org/freedesktop/GeoClue2/Client/3

New location:
Latitude:    <REDACTED>?
Longitude:   <REDACTED>?
Accuracy:    25000.000000 meters
Speed:       0.000000 meters/second
Description: ipf fallback (from GeoIP data)
Timestamp:   Tue Jul 22 12:02:08 2025 (1753171328 seconds since the Epoch)
[–] hyveltjuven@lemmy.world 1 points 4 days ago (1 children)

Just noticed that your accuarcy is at 25000 meters as well, are you getting anywhere near your actual location in map applications?

[–] balsoft@lemmy.ml 1 points 3 days ago

Well, it gets the city right at least, and that's enough for me

load more comments (2 replies)
load more comments (2 replies)