From 119d3a2a0fff5c8bf60b49c70d713860a2a0019a Mon Sep 17 00:00:00 2001 From: "Alexander \"PapaTutuWawa" Date: Tue, 7 Sep 2021 15:40:07 +0200 Subject: [PATCH] surface: Add more tweaks from linux-surface --- hosts/mashu.nix | 2 +- modules/hardware/surface-pro6.nix | 25 ++++++++++++++++++++----- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/hosts/mashu.nix b/hosts/mashu.nix index 9bd4c24..de71f46 100644 --- a/hosts/mashu.nix +++ b/hosts/mashu.nix @@ -35,7 +35,7 @@ in mkHost config { ]; extraOptions = old: { boot = { - kernelParams = [ "mem_sleep_default=deep" ]; + kernelParams = [ "mem_sleep_default=deep" "kernel.nmi_watchdog=0" "vm.dirty_writeback_centisecs=1500" ]; extraModprobeConfig = '' options i915 enable_fbc=1 enable_rc6=1 modeset=1 options snd_hda_intel power_save=1 diff --git a/modules/hardware/surface-pro6.nix b/modules/hardware/surface-pro6.nix index 4e0afd3..a22e759 100644 --- a/modules/hardware/surface-pro6.nix +++ b/modules/hardware/surface-pro6.nix @@ -12,10 +12,16 @@ let }; }; in { - environment.etc."ipts.conf".text = '' - [Config] - BlockOnPalm = true - ''; + environment.etc = { + "ipts.conf".text = '' + [Config] + BlockOnPalm = true + ''; + "thermald/thermal-cpu-cdev-order.xml".source = fetchurl { + url = "https://raw.githubusercontent.com/linux-surface/linux-surface/${commit}/contrib/thermald/surface_pro_5/thermal-conf.xml.auto.mobile"; + sha256 = "1wsrgad6k4haw4m0jjcjxhmj4742kcb3q8rmfpclbw0czm8384al"; + } + }; powerManagement = { enable = true; @@ -34,7 +40,16 @@ in { }; }; environment.systemPackages = with pkgs; [ iptsd surface-control ]; - services.udev.packages = with pkgs; [ iptsd surface-control ]; + services = { + udev.packages = with pkgs; [ iptsd surface-control ]; + thermald = { + enable = true; + configFile = fetchurl { + url = "https://raw.githubusercontent.com/linux-surface/linux-surface/${commit}/contrib/thermald/thermal-conf.xml"; + sha256 = "1xj70n9agy41906jgm4yjmsx58i7pzsizpvv3rkzq78k95qjfmc9"; + }; + }; + }; boot = { kernelPackages = pkgs.linuxPackages_5_13;