change iptsd and system-control to nixpkgs versions - fixes iptsd bug

This commit is contained in:
Flameopathic 2024-06-20 20:45:41 -04:00 committed by GitHub
parent 083823b790
commit 27487bcd12
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 6 additions and 81 deletions

View file

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

View file

@ -1,48 +0,0 @@
{ config, lib, pkgs, ... }:
let
inherit (lib) mkDefault mkEnableOption mkIf mkMerge mkOption types;
cfg = config.microsoft-surface.ipts;
iptsConfFile = pkgs.writeTextFile {
name = "iptsd.conf";
text = lib.generators.toINI { } cfg.config;
};
in
{
options.microsoft-surface.ipts = {
enable = mkEnableOption "Enable IPTSd for Microsoft Surface";
config = mkOption {
type = types.attrs;
default = { };
description = ''
Values to wrote to iptsd.conf, first key is section, second key is property.
See the example config; https://github.com/linux-surface/iptsd/blob/v1.4.0/etc/iptsd.conf
'';
example = ''
DFT = {
ButtonMinMag = 1000;
};
'';
};
};
config = mkMerge [
{
microsoft-surface.ipts.enable = mkDefault false;
}
(mkIf cfg.enable {
systemd.services.iptsd = {
description = "IPTSD";
path = with pkgs; [ iptsd ];
script = "iptsd $(iptsd-find-hidraw)";
wantedBy = [ "multi-user.target" ];
};
environment.etc."iptsd/iptsd.conf".source = "${iptsConfFile}";
})
];
}

View file

@ -1,25 +0,0 @@
{ config, lib, pkgs, ... }:
let
inherit (lib) mkDefault mkEnableOption mkIf mkMerge;
cfg = config.microsoft-surface.surface-control;
in {
options.microsoft-surface.surface-control = {
enable = mkEnableOption "Enable 'surface-control' for Microsoft Surface";
};
config = mkMerge [
{
microsoft-surface.surface-control.enable = mkDefault false;
}
(mkIf cfg.enable {
environment.systemPackages = with pkgs; [ surface-control ];
services.udev.packages = with pkgs; [ surface-control];
users.groups.surface-control = { };
})
];
}

View file

@ -1,4 +1,4 @@
{ ... }:
{ lib, pkgs, ... }:
# This module is intended to support the Surface Laptop range, specifically those with AMD CPUs.
# It's expected it will work equally well on many other Surface models, but they may need further
@ -15,6 +15,6 @@
];
# Note: The IPTS module is not often required on devices with Surface Laptop 3 (AMD).
microsoft-surface.ipts.enable = true;
microsoft-surface.surface-control.enable = true;
services.iptsd.enable = lib.mkDefault true;
environment.systemPackages = [ pkgs.surface-control ];
}

View file

@ -1,4 +1,4 @@
{ ... }:
{ lib, pkgs, ... }:
# This module is intended to support the Surface Pro range, specifically those with Intel CPUs.
# It's expected it will work equally well on many other Surface models, but they may need further
@ -13,6 +13,6 @@
../../../common/cpu/intel
];
microsoft-surface.ipts.enable = true;
microsoft-surface.surface-control.enable = true;
services.iptsd.enable = lib.mkDefault true;
environment.systemPackages = [ pkgs.surface-control ];
}