iio-sensor-proxy: init at 2.2 and nixos module

This PR adds support for ```iio-sensor-proxy``` used by GNOME v3 and
others for reading data from the accelerometer, gps, compass and similar sensors
built into some relatively recent laptops.

Additionally, there is a NixOS module exposed via hardware.sensor.iio
for enabling services, udev rules and dbus services.

+80
+30
nixos/modules/hardware/sensor/iio.nix
··· 1 + { config, lib, pkgs, ... }: 2 + 3 + with lib; 4 + 5 + { 6 + ###### interface 7 + 8 + options = { 9 + hardware.sensor.iio = { 10 + enable = mkOption { 11 + description = "Enable this option to support IIO sensors."; 12 + type = types.bool; 13 + default = false; 14 + }; 15 + }; 16 + }; 17 + 18 + ###### implementation 19 + 20 + config = mkIf config.hardware.sensor.iio.enable { 21 + 22 + boot.initrd.availableKernelModules = [ "hid-sensor-hub" ]; 23 + 24 + environment.systemPackages = with pkgs; [ iio-sensor-proxy ]; 25 + 26 + services.dbus.packages = with pkgs; [ iio-sensor-proxy ]; 27 + services.udev.packages = with pkgs; [ iio-sensor-proxy ]; 28 + systemd.packages = with pkgs; [ iio-sensor-proxy ]; 29 + }; 30 + }
+1
nixos/modules/module-list.nix
··· 29 29 ./hardware/ckb.nix 30 30 ./hardware/cpu/amd-microcode.nix 31 31 ./hardware/cpu/intel-microcode.nix 32 + ./hardware/sensor/iio.nix 32 33 ./hardware/ksm.nix 33 34 ./hardware/network/b43.nix 34 35 ./hardware/network/intel-2100bg.nix
+47
pkgs/os-specific/linux/iio-sensor-proxy/default.nix
··· 1 + { stdenv, fetchFromGitHub, autoconf-archive, gettext, libtool, intltool, autoconf, automake 2 + , glib, gtk3, gtk_doc, libgudev, pkgconfig, systemd }: 3 + 4 + stdenv.mkDerivation rec { 5 + name = "iio-sensor-proxy-${version}"; 6 + version = "2.2"; 7 + 8 + src = fetchFromGitHub { 9 + owner = "hadess"; 10 + repo = "iio-sensor-proxy"; 11 + rev = version; 12 + sha256 = "1x0whwm2r9g50hq5px0bgsrigy8naihqgi6qm0x5q87jz5lkhrnv"; 13 + }; 14 + 15 + configurePhase = '' 16 + ./autogen.sh --prefix=$out \ 17 + --with-udevrulesdir=$out/lib/udev/rules.d \ 18 + --with-systemdsystemunitdir=$out/lib/systemd/system 19 + ''; 20 + 21 + buildInputs = [ 22 + glib 23 + gtk3 24 + gtk_doc 25 + libgudev 26 + systemd 27 + ]; 28 + 29 + nativeBuildInputs = [ 30 + autoconf 31 + autoconf-archive 32 + automake 33 + gettext 34 + intltool 35 + libtool 36 + pkgconfig 37 + ]; 38 + 39 + meta = with stdenv.lib; { 40 + description = "Proxy for sending IIO sensor data to D-Bus"; 41 + homepage = https://github.com/hadess/iio-sensor-proxy; 42 + license = licenses.gpl3 ; 43 + maintainers = with maintainers; [ peterhoeg ]; 44 + platforms = platforms.linux; 45 + inherit version; 46 + }; 47 + }
+2
pkgs/top-level/all-packages.nix
··· 932 932 933 933 long-shebang = callPackage ../misc/long-shebang {}; 934 934 935 + iio-sensor-proxy = callPackage ../os-specific/linux/iio-sensor-proxy { }; 936 + 935 937 mathics = pythonPackages.mathics; 936 938 937 939 meson = callPackage ../development/tools/build-managers/meson { };