Extract IPTSd management into new option-enabled module

This commit is contained in:
mexisme 2023-01-10 15:59:44 +13:00
parent 51122e95a1
commit 0ce988ea8a
3 changed files with 29 additions and 7 deletions

View file

@ -6,6 +6,7 @@ let
in { in {
imports = [ imports = [
./kernel ./kernel
./ipts
]; ];
microsoft-surface.kernelVersion = mkDefault "6.0.11"; microsoft-surface.kernelVersion = mkDefault "6.0.11";

View file

@ -0,0 +1,27 @@
{ 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 ];
script = "iptsd";
wantedBy = [ "multi-user.target" ];
};
})
];
}

View file

@ -25,11 +25,5 @@ in {
pkgs.surface-control pkgs.surface-control
]; ];
systemd.services.iptsd = { microsoft-surface.ipts.enable = true;
description = "IPTSD";
script = "${pkgs.iptsd}/bin/iptsd";
wantedBy = [
"multi-user.target"
];
};
} }