summary refs log tree commit diff
path: root/nixos/modules/hardware/logitech.nix
diff options
context:
space:
mode:
authorPeter Hoeg <peter@hoeg.com>2019-03-11 13:10:31 +0800
committerPeter Hoeg <peter@hoeg.com>2019-03-19 09:58:57 +0800
commitfe97297bb1c3794e90f7acc39eb97720866fd6c4 (patch)
tree09c49e025e05cb587934e17061ed48b02d48130f /nixos/modules/hardware/logitech.nix
parent86cff5f5d7a8b172cae4d1e461a4e0d7844666d2 (diff)
downloadnixpkgs-fe97297bb1c3794e90f7acc39eb97720866fd6c4.tar
nixpkgs-fe97297bb1c3794e90f7acc39eb97720866fd6c4.tar.gz
nixpkgs-fe97297bb1c3794e90f7acc39eb97720866fd6c4.tar.bz2
nixpkgs-fe97297bb1c3794e90f7acc39eb97720866fd6c4.tar.lz
nixpkgs-fe97297bb1c3794e90f7acc39eb97720866fd6c4.tar.xz
nixpkgs-fe97297bb1c3794e90f7acc39eb97720866fd6c4.tar.zst
nixpkgs-fe97297bb1c3794e90f7acc39eb97720866fd6c4.zip
logitech (nixos): support module for logitech input devices
Diffstat (limited to 'nixos/modules/hardware/logitech.nix')
-rw-r--r--nixos/modules/hardware/logitech.nix28
1 files changed, 28 insertions, 0 deletions
diff --git a/nixos/modules/hardware/logitech.nix b/nixos/modules/hardware/logitech.nix
new file mode 100644
index 00000000000..d6f43bdddcc
--- /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 ];
+  };
+}