about summary refs log tree commit diff
path: root/modules/nixos-hardware/common
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2020-05-07 13:45:16 +0000
committerAlyssa Ross <hi@alyssa.is>2020-05-07 13:45:16 +0000
commitae3b78289010b14f2151434bed6282b3689e7444 (patch)
treecd9965d93eaf6b4fd497dc5c500fc9dc880382c5 /modules/nixos-hardware/common
parent199fc8816a6660627fd4b684ba078e9969ce33c7 (diff)
parent565f837027469fc6c8f9256dea1cfad0dab4f2dc (diff)
downloadnixlib-ae3b78289010b14f2151434bed6282b3689e7444.tar
nixlib-ae3b78289010b14f2151434bed6282b3689e7444.tar.gz
nixlib-ae3b78289010b14f2151434bed6282b3689e7444.tar.bz2
nixlib-ae3b78289010b14f2151434bed6282b3689e7444.tar.lz
nixlib-ae3b78289010b14f2151434bed6282b3689e7444.tar.xz
nixlib-ae3b78289010b14f2151434bed6282b3689e7444.tar.zst
nixlib-ae3b78289010b14f2151434bed6282b3689e7444.zip
Merge commit '565f837027469fc6c8f9256dea1cfad0dab4f2dc'
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;
 }