diff --git a/microsoft/surface/common/default.nix b/microsoft/surface/common/default.nix index 7499a19..057142c 100644 --- a/microsoft/surface/common/default.nix +++ b/microsoft/surface/common/default.nix @@ -6,8 +6,6 @@ let in { imports = [ ./kernel - ./ipts - ./surface-control ]; microsoft-surface.kernelVersion = mkDefault "6.6"; diff --git a/microsoft/surface/common/ipts/default.nix b/microsoft/surface/common/ipts/default.nix deleted file mode 100644 index 8e1f475..0000000 --- a/microsoft/surface/common/ipts/default.nix +++ /dev/null @@ -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}"; - }) - ]; -} diff --git a/microsoft/surface/common/surface-control/default.nix b/microsoft/surface/common/surface-control/default.nix deleted file mode 100644 index 4927c24..0000000 --- a/microsoft/surface/common/surface-control/default.nix +++ /dev/null @@ -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 = { }; - }) - ]; -} diff --git a/microsoft/surface/surface-laptop-amd/default.nix b/microsoft/surface/surface-laptop-amd/default.nix index 4985911..644b7d9 100644 --- a/microsoft/surface/surface-laptop-amd/default.nix +++ b/microsoft/surface/surface-laptop-amd/default.nix @@ -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 ]; } diff --git a/microsoft/surface/surface-pro-intel/default.nix b/microsoft/surface/surface-pro-intel/default.nix index 2cfa95d..20ebbba 100644 --- a/microsoft/surface/surface-pro-intel/default.nix +++ b/microsoft/surface/surface-pro-intel/default.nix @@ -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;