Enabling iio-sensor-proxy

I am trying to install iio-sensor-proxy to to use screen autorotation in Gnome3. Following the wiki, I have added:

  hardware.sensor.iio.enable = true;

to configuration.nix. This seems to be insufficient to get the command iio-sensor-proxy, so I also added iio-sensor-proxy to environment.systemPackages. I have also tried to install it using nix-env -iA nixos.iio-sensor-proxy. I would expect the service to be enabled after restarting, but monitor-sensor just outputs

Waiting for iio-sensor-proxy to appear.

When I call iio-sensor-proxy after having installed it with nix-env, it just exits without any output.

Am I missing something?

Using NixOs 20.03.2425.9a3e34ae601 (Markhor).

I have the suspicion that this has to do with the old GitHub repo for iio-sensor-proxy not being there anymore. My knowledge of Nix is quite limited but I will try to make the derivation point to the new repository.

I use KDE and not Gnome, but there all it takes is setting the option you mention:

hardware.sensor.iio.enable = true;

Adding it to systemPackages doesn’t do anything else but give you the detect bin (and the other binaries) in your path.

1 Like

Thank you, having confirmation that it should work was indeed useful. The problem was somewhere else completely: new generations were not appearing on the GRUB menu and the same old generation was loading again and again each time I restarted to test iio-sensor-proxy. So, it was quite a stupid error having nothing to do with iio-sensor-proxy nor gnome (should I change the title to make this more useful to others?).