nixos-config/modules/services/logiops/default.nix

43 lines
1007 B
Nix
Raw Normal View History

2022-05-29 17:06:32 +00:00
{ lib, pkgs, config, ... }:
let
cfg = config.ptw.services.logiops;
in {
options.ptw.services.logiops = {
enable = lib.mkEnableOption "Enable logiops";
2022-05-30 12:52:07 +00:00
renice = lib.mkOption {
description = "Set the nice value of the process";
default = true;
};
reniceValue = lib.mkOption {
description = "Set the nice value of the process";
default = -19;
};
2022-05-29 17:06:32 +00:00
};
config = lib.mkIf true {
2022-05-30 12:52:07 +00:00
environment.etc."logid.cfg".text = ''
2022-05-29 17:06:32 +00:00
devices: (
{
name: "Wireless Mouse MX Master 3";
hiresscroll: {
hires: true;
};
dpi: 800;
}
);
'';
systemd.services.logiops = {
description = "An unofficial userspace driver for HID++ Logitech devices";
wantedBy = [ "default.target" ];
serviceConfig = {
Type = "simple";
2022-05-30 12:52:07 +00:00
ExecStart = let
renice = lib.optionalString cfg.renice "${pkgs.coreutils-full}/bin/nice -n ${builtins.toString cfg.reniceValue}";
in "${renice} ${pkgs.logiops}/bin/logid";
2022-05-29 17:06:32 +00:00
};
};
};
}