Open SrTobi opened 1 month ago
Hmmm yeah I guess we should do that when services.geoclue2.enableNmea
is enabled.
Since the fix is one line, I added it to https://github.com/NixOS/nixpkgs/pull/329654 although the PR is unrelated. Note that since enableNmea
is enabled by default, this now pulls in avahi even though avahi isn't necessary for most of the providers (definitely not wifi and static, I haven't tested the others). I consider this minor since someone concerned with minimalism can always disable this with enableNmea = false
. We don't have the granularity to know whether enableNmea
was explicitly enabled anyways.
@SrTobi to be clear your provider is NMEA, correct?
Ok, please wait before merging this... today geoclue isn't working for me anymore even though the avahi service is enabled... I can therefore not be sure if my assessment above is correct... I have to investigate this further.
Some steps that may help narrow the issue:
How are you testing that geoclue works? Through redshift? What does the demo-agent show, e.g. /nix/store/fbs4f1xrx0bj3mggc0rqxx7p91z16ccm-geoclue-2.7.0/libexec/geoclue-2.0/demos/where-am-i
(the path to geoclue can be found with ls /nix/store | grep geoclue-2.7.0
, for example).
What is your intended provider? (e.g. nmea, wifi, static-source). Does it work if you set your location statically like https://github.com/NixOS/nixpkgs/issues/311595#issuecomment-2247989491?
What do systemctl status geoclue.service
, journalctl -u geoclue.service
, systemctl status --user geoclue-agent.service
, journalctl --user-unit=geoclue-agent.service
, systemctl status --user redshift.service
, and journalctl --user-unit redshift.service
show? If systemctl restart geoclue.service
fixes the issue (i.e. the issue only happens at boot), the boot log journalctl -b
can also be useful.
Presumably redshift used to work and recently broke. Since the module hasn't been changed in months (https://github.com/NixOS/nixpkgs/commit/6afb255d976f85f3359e4929abd6f5149c323a02), what caused the change? did you upgrade recently? Otherwise, if your provider is wifi, I can think of https://github.com/NixOS/nixpkgs/issues/321121 as a possible culprit.
Please refer to #321121 for more information on why geoclue2
is currently failing. That fact that it is no longer working probably has nothing to do with the changes proposed in https://github.com/NixOS/nixpkgs/pull/329654.
The current working premise implied by https://github.com/NixOS/nixpkgs/issues/329522#issuecomment-2246679016 is that the author of the issue is using the nmea provider, which to the best of my knowledge is the only provider which requires the avahi service. If they were using the wifi provider (the only provider affected by the Mozilla Location Service (MLS) changes), avahi isn't relevant.
The PR https://github.com/NixOS/nixpkgs/pull/329654 adds the static (and compass) source(s), allowing one to circumvent the MLS issues with manual intervention. I initially included the unrelated fix to enable avahi when nmea is enabled since it was simple, but I've since removed it due to the concerns in https://github.com/NixOS/nixpkgs/issues/329522#issuecomment-2249569279.
Re: MLS I already mentioned this in my 4th point of https://github.com/NixOS/nixpkgs/issues/329522#issuecomment-2249622510.
Describe the bug
I noticed that redshift doesn't find the location via geoclue2 anymore. It seems that geoclue2 requires another service called
avahi
, which didn't run on my system.Setting
enables the geoclue2 service, but that one fails to provide location data. Asking for the status gives
after manually enabling
avahi
viaEverything works fine...
Note: I think for many people the avahi service is automatically enabled by other settings. For example guix, gnome, and pulseaudio with hasZeroconf will enable avahi.
Expected behavior
I think when the geoclue2 service is enabled, the avahi service should be enabled too.
Notify maintainers
@davidak, @bobby285271
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.Add a :+1: reaction to issues you find important.