diff options
author | Peter Hoeg <peter@speartail.com> | 2017-03-14 11:16:09 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-14 11:16:09 +0800 |
commit | 80750f459cec57f6f4ffe04a0f566a3e6bca31d5 (patch) | |
tree | f220877281d030d649d062e4073ce925697b223e /nixos/modules/hardware | |
parent | 25e75cd5805fe427b1588ed87b108a29cfb81e80 (diff) | |
parent | e4d8cb8dabb0b7ec7b5f785a5cebd34909df0603 (diff) |
Merge pull request #17303 from peterhoeg/iio
iio-sensor-proxy: init at 2.2 and nixos module
Diffstat (limited to 'nixos/modules/hardware')
-rw-r--r-- | nixos/modules/hardware/sensor/iio.nix | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/nixos/modules/hardware/sensor/iio.nix b/nixos/modules/hardware/sensor/iio.nix new file mode 100644 index 0000000000000..a8bc188000214 --- /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 ]; + }; +} |