2023-01-10 03:59:44 +01:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
inherit (lib) mkDefault mkEnableOption mkIf mkMerge;
|
|
|
|
|
|
|
|
cfg = config.microsoft-surface.ipts;
|
|
|
|
|
|
|
|
in {
|
|
|
|
options.microsoft-surface.ipts = {
|
|
|
|
enable = mkEnableOption "Enable IPTSd for Microsoft Surface";
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkMerge [
|
|
|
|
{
|
|
|
|
microsoft-surface.ipts.enable = mkDefault false;
|
|
|
|
}
|
|
|
|
|
|
|
|
(mkIf cfg.enable {
|
|
|
|
systemd.services.iptsd = {
|
|
|
|
description = "IPTSD";
|
|
|
|
path = with pkgs; [ iptsd ];
|
2023-06-20 16:49:07 +02:00
|
|
|
script = "iptsd $(iptsd-find-hidraw)";
|
2023-01-10 03:59:44 +01:00
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
};
|
|
|
|
})
|
|
|
|
];
|
|
|
|
}
|