From fe97297bb1c3794e90f7acc39eb97720866fd6c4 Mon Sep 17 00:00:00 2001 From: Peter Hoeg Date: Mon, 11 Mar 2019 13:10:31 +0800 Subject: logitech (nixos): support module for logitech input devices --- nixos/modules/hardware/logitech.nix | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 nixos/modules/hardware/logitech.nix (limited to 'nixos/modules/hardware/logitech.nix') 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 ]; + }; +} -- cgit 1.4.1