1
0
Fork 0
mirror of https://github.com/NixOS/nixos-hardware synced 2024-12-27 12:09:45 +01:00

Merge pull request #1004 from Flameopathic/iptsd

surface: remove broken iptsd and surface-control configuration
This commit is contained in:
Jörg Thalheim 2024-06-23 14:16:23 +02:00 committed by GitHub
commit 3fff0d97d1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 7 additions and 82 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, ... }:
{ 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,9 +13,9 @@
../../../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 ];
services.thermald = lib.mkDefault {
enable = true;
configFile = ./thermal-conf.xml;