From fdcd4e16c2dbd942ce4b3bc83eef3b605e6a4531 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Mon, 5 Aug 2024 16:37:18 +0200 Subject: [PATCH] dosei: add temporary logiops module --- hosts/dosei/configuration.nix | 1 + hosts/dosei/services/logiops.nix | 52 ++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 hosts/dosei/services/logiops.nix diff --git a/hosts/dosei/configuration.nix b/hosts/dosei/configuration.nix index 339078b..aa9acc9 100644 --- a/hosts/dosei/configuration.nix +++ b/hosts/dosei/configuration.nix @@ -6,6 +6,7 @@ ./services/avahi.nix ./services/docker.nix ./services/jenkins.nix + ./services/logiops.nix ./services/wstunnel.nix ]; diff --git a/hosts/dosei/services/logiops.nix b/hosts/dosei/services/logiops.nix new file mode 100644 index 0000000..b71c098 --- /dev/null +++ b/hosts/dosei/services/logiops.nix @@ -0,0 +1,52 @@ +{ pkgs, ... }: +{ + # TODO: remove when merged: https://github.com/NixOS/nixpkgs/pull/167388 + systemd.services.logid = let + config = pkgs.writeText "logid.cfg" '' + devices: ( + { + name: "Wireless Mouse MX Master"; + smartshift: + { + on: true; + threshold: 30; + torque: 50; + }; + hiresscroll: + { + hires: true; + invert: false; + target: true; + up: { + mode: "Axis"; + axis: "REL_WHEEL_HI_RES"; + multiplier: 1; + }, + down: { + mode: "Axis"; + axis: "REL_WHEEL_HI_RES"; + multiplier: -1; + }, + }; + dpi: 800; + } + ); + ''; + in { + description = "Logitech Configuration Daemon"; + startLimitIntervalSec = 0; + wants = [ "multi-user.target" ]; + after = [ "multi-user.target" ]; + wantedBy = [ "graphical-session.target" ]; + + serviceConfig = { + Type = "simple"; + ExecStart = "${pkgs.logiops}/bin/logid --config ${config}"; + User = "root"; + ExecReload = "/bin/kill -HUP $MAINPID"; + Restart="on-failure"; + }; + }; + + hardware.logitech.wireless.enable = true; +}