about summary refs log tree commit diff
path: root/modules/nixos-hardware/common
diff options
context:
space:
mode:
Diffstat (limited to 'modules/nixos-hardware/common')
-rw-r--r--modules/nixos-hardware/common/cpu/intel/default.nix1
-rw-r--r--modules/nixos-hardware/common/pc/laptop/cpu-throttling-bug.nix38
-rw-r--r--modules/nixos-hardware/common/pc/ssd/default.nix2
3 files changed, 3 insertions, 38 deletions
diff --git a/modules/nixos-hardware/common/cpu/intel/default.nix b/modules/nixos-hardware/common/cpu/intel/default.nix
index 7f2223c72e40..ad945f394a6c 100644
--- a/modules/nixos-hardware/common/cpu/intel/default.nix
+++ b/modules/nixos-hardware/common/cpu/intel/default.nix
@@ -10,5 +10,6 @@
     vaapiIntel
     vaapiVdpau
     libvdpau-va-gl
+    intel-media-driver
   ];
 }
diff --git a/modules/nixos-hardware/common/pc/laptop/cpu-throttling-bug.nix b/modules/nixos-hardware/common/pc/laptop/cpu-throttling-bug.nix
deleted file mode 100644
index a44bb7225d0f..000000000000
--- a/modules/nixos-hardware/common/pc/laptop/cpu-throttling-bug.nix
+++ /dev/null
@@ -1,38 +0,0 @@
-{ config, pkgs, ... }:
-{
-  # Temporary fix for cpu throttling issues visible in the kernel log
-  # (journalctl -k) by setting the same temperature limits used by
-  # Window$
-  # See https://wiki.archlinux.org/index.php/Lenovo_ThinkPad_X1_Carbon_(Gen_6)#Power_management.2FThrottling_issues
-  systemd.services.cpu-throttling = {
-    enable = true;
-    description = "Sets the offset to 3 °C, so the new trip point is 97 °C";
-    documentation = [
-      "https://wiki.archlinux.org/index.php/Lenovo_ThinkPad_X1_Carbon_(Gen_6)#Power_management.2FThrottling_issues"
-    ];
-    path = [ pkgs.msr-tools ];
-    script = "wrmsr -a 0x1a2 0x3000000";
-    serviceConfig = {
-      Type = "oneshot";
-    };
-    wantedBy = [
-      "timers.target"
-    ];
-  };
-
-  systemd.timers.cpu-throttling = {
-    enable = true;
-    description = "Set cpu heating limit to 97 °C";
-    documentation = [
-      "https://wiki.archlinux.org/index.php/Lenovo_ThinkPad_X1_Carbon_(Gen_6)#Power_management.2FThrottling_issues"
-    ];
-    timerConfig = {
-      OnActiveSec = 60;
-      OnUnitActiveSec = 60;
-      Unit = "cpu-throttling.service";
-    };
-    wantedBy = [
-      "timers.target"
-    ];
-  };
-}
diff --git a/modules/nixos-hardware/common/pc/ssd/default.nix b/modules/nixos-hardware/common/pc/ssd/default.nix
index af0b49568cd1..00922e649938 100644
--- a/modules/nixos-hardware/common/pc/ssd/default.nix
+++ b/modules/nixos-hardware/common/pc/ssd/default.nix
@@ -4,4 +4,6 @@
   boot.kernel.sysctl = {
     "vm.swappiness" = lib.mkDefault 1;
   };
+
+  services.fstrim.enable = lib.mkDefault true;
 }