diff options
Diffstat (limited to 'nixos/modules')
-rw-r--r-- | nixos/modules/hardware/sensor/iio.nix | 30 | ||||
-rw-r--r-- | nixos/modules/module-list.nix | 1 |
2 files changed, 31 insertions, 0 deletions
diff --git a/nixos/modules/hardware/sensor/iio.nix b/nixos/modules/hardware/sensor/iio.nix new file mode 100644 index 000000000000..a8bc18800021 --- /dev/null +++ b/nixos/modules/hardware/sensor/iio.nix @@ -0,0 +1,30 @@ +{ config, lib, pkgs, ... }: + +with lib; + +{ + ###### interface + + options = { + hardware.sensor.iio = { + enable = mkOption { + description = "Enable this option to support IIO sensors."; + type = types.bool; + default = false; + }; + }; + }; + + ###### implementation + + config = mkIf config.hardware.sensor.iio.enable { + + boot.initrd.availableKernelModules = [ "hid-sensor-hub" ]; + + environment.systemPackages = with pkgs; [ iio-sensor-proxy ]; + + services.dbus.packages = with pkgs; [ iio-sensor-proxy ]; + services.udev.packages = with pkgs; [ iio-sensor-proxy ]; + systemd.packages = with pkgs; [ iio-sensor-proxy ]; + }; +} diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 7d2ae4a571c4..c9f1fad0d0e9 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -29,6 +29,7 @@ ./hardware/ckb.nix ./hardware/cpu/amd-microcode.nix ./hardware/cpu/intel-microcode.nix + ./hardware/sensor/iio.nix ./hardware/ksm.nix ./hardware/mcelog.nix ./hardware/network/b43.nix |