From fe97297bb1c3794e90f7acc39eb97720866fd6c4 Mon Sep 17 00:00:00 2001 From: Peter Hoeg Date: Mon, 11 Mar 2019 13:10:31 +0800 Subject: [PATCH] logitech (nixos): support module for logitech input devices --- nixos/modules/hardware/logitech.nix | 28 ++++++++++++++++++++++++++++ nixos/modules/module-list.nix | 1 + 2 files changed, 29 insertions(+) create mode 100644 nixos/modules/hardware/logitech.nix diff --git a/nixos/modules/hardware/logitech.nix b/nixos/modules/hardware/logitech.nix new file mode 100644 index 000000000000..d6f43bdddcc8 --- /dev/null +++ b/nixos/modules/hardware/logitech.nix @@ -0,0 +1,28 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.hardware.logitech; + +in { + options.hardware.logitech = { + enable = mkEnableOption "Logitech Devices"; + + enableGraphical = mkOption { + type = types.bool; + default = false; + description = "Enable graphical support applications."; + }; + }; + + config = lib.mkIf cfg.enable { + environment.systemPackages = [ + pkgs.ltunify + ] ++ lib.optional cfg.enableGraphical pkgs.solaar; + + # ltunifi and solaar both provide udev rules but the most up-to-date have been split + # out into a dedicated derivation + services.udev.packages = with pkgs; [ logitech-udev-rules ]; + }; +} diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index b2f2c1ac8cbc..505d5a0b5c33 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -45,6 +45,7 @@ ./hardware/sensor/iio.nix ./hardware/ksm.nix ./hardware/ledger.nix + ./hardware/logitech.nix ./hardware/mcelog.nix ./hardware/network/b43.nix ./hardware/nitrokey.nix