about summary refs log tree commit diff
path: root/modules/nixos-hardware/dell
diff options
context:
space:
mode:
Diffstat (limited to 'modules/nixos-hardware/dell')
-rw-r--r--modules/nixos-hardware/dell/g3/3779/default.nix24
-rw-r--r--modules/nixos-hardware/dell/precision/5530/default.nix22
-rw-r--r--modules/nixos-hardware/dell/xps/13-7390/default.nix4
-rw-r--r--modules/nixos-hardware/dell/xps/13-9343/default.nix12
-rw-r--r--modules/nixos-hardware/dell/xps/13-9360/default.nix10
-rw-r--r--modules/nixos-hardware/dell/xps/13-9360/qca6174-firmware.nix26
-rw-r--r--modules/nixos-hardware/dell/xps/15-9500/README.wiki22
-rw-r--r--modules/nixos-hardware/dell/xps/15-9500/default.nix21
-rw-r--r--modules/nixos-hardware/dell/xps/15-9500/nvidia/default.nix15
-rw-r--r--modules/nixos-hardware/dell/xps/15-9500/thermald-conf.xml205
-rw-r--r--modules/nixos-hardware/dell/xps/15-9550/README.wiki9
-rw-r--r--modules/nixos-hardware/dell/xps/15-9550/nvidia/default.nix15
12 files changed, 348 insertions, 37 deletions
diff --git a/modules/nixos-hardware/dell/g3/3779/default.nix b/modules/nixos-hardware/dell/g3/3779/default.nix
new file mode 100644
index 000000000000..8c9b3d328bd0
--- /dev/null
+++ b/modules/nixos-hardware/dell/g3/3779/default.nix
@@ -0,0 +1,24 @@
+{ lib, pkgs, ... }:
+
+{
+  imports = [
+    ../../../common/cpu/intel
+    ../../../common/gpu/nvidia.nix
+    ../../../common/pc/laptop
+    ../../../common/pc/laptop/ssd
+  ];
+
+  # Specify bus id of Nvidia and Intel graphics
+  hardware.nvidia.prime = {
+    intelBusId = "PCI:0:2:0";
+    nvidiaBusId = "PCI:1:0:0";
+  };
+
+  # Cooling management
+  services.thermald.enable = lib.mkDefault true;
+
+  # Use same ACPI identifier as Dell Ubuntu
+  boot.kernelParams = [
+    "acpi_osi=Linux-Dell-Video"
+  ];
+}
diff --git a/modules/nixos-hardware/dell/precision/5530/default.nix b/modules/nixos-hardware/dell/precision/5530/default.nix
new file mode 100644
index 000000000000..52e0dd555425
--- /dev/null
+++ b/modules/nixos-hardware/dell/precision/5530/default.nix
@@ -0,0 +1,22 @@
+{ lib, pkgs, ... }:
+
+{
+  imports = [
+    ../../../common/cpu/intel
+    ../../../common/pc/laptop
+    ../../../common/pc/laptop/ssd
+  ];
+
+  # https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1803179/comments/149
+  # fix lspci hanging with nouveau
+  boot.kernelParams = [
+    "acpi_rev_override=1"
+    "acpi_osi=Linux"
+    "nouveau.modeset=0"
+    "pcie_aspm=force"
+    "drm.vblankoffdelay=1"
+    "scsi_mod.use_blk_mq=1"
+    "nouveau.runpm=0"
+    "mem_sleep_default=deep"
+  ];
+}
diff --git a/modules/nixos-hardware/dell/xps/13-7390/default.nix b/modules/nixos-hardware/dell/xps/13-7390/default.nix
index 991e4352cb50..1aa0c4bcd3dd 100644
--- a/modules/nixos-hardware/dell/xps/13-7390/default.nix
+++ b/modules/nixos-hardware/dell/xps/13-7390/default.nix
@@ -9,5 +9,9 @@
 
   boot.kernelParams = [ "mem_sleep_default=deep" ];
 
+  # older version break wifi:
+  # - https://github.com/NixOS/nixos-hardware/issues/173
+  boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "5.6") pkgs.linuxPackages_latest;
+
   services.thermald.enable = true;
 }
diff --git a/modules/nixos-hardware/dell/xps/13-9343/default.nix b/modules/nixos-hardware/dell/xps/13-9343/default.nix
new file mode 100644
index 000000000000..2904a773c7b4
--- /dev/null
+++ b/modules/nixos-hardware/dell/xps/13-9343/default.nix
@@ -0,0 +1,12 @@
+{ lib, ... }:
+
+{
+  imports = [
+    ../../../common/cpu/intel
+    ../../../common/pc/laptop
+    ../../../common/pc/laptop/ssd
+  ];
+
+  # This will save you money and possibly your life!
+  services.thermald.enable = lib.mkDefault true;
+}
diff --git a/modules/nixos-hardware/dell/xps/13-9360/default.nix b/modules/nixos-hardware/dell/xps/13-9360/default.nix
index 5ff1e54a46b6..68eedc8c57f5 100644
--- a/modules/nixos-hardware/dell/xps/13-9360/default.nix
+++ b/modules/nixos-hardware/dell/xps/13-9360/default.nix
@@ -14,16 +14,6 @@
     systemd-boot.enable = lib.mkDefault true;
   };
 
-  hardware.firmware = lib.mkBefore [ pkgs.qca6174-firmware ];
-
-  # TODO: move to general HiDPI profile
-  i18n.consoleFont = lib.mkDefault "latarcyrheb-sun32"; # 4K screen, use bigger console font
-
-  # TODO: upstream to NixOS/nixpkgs
-  nixpkgs.overlays = [(final: previous: {
-    qca6174-firmware = final.callPackage ./qca6174-firmware.nix {};
-  })];
-
   # This will save you money and possibly your life!
   services.thermald.enable = true;
 }
diff --git a/modules/nixos-hardware/dell/xps/13-9360/qca6174-firmware.nix b/modules/nixos-hardware/dell/xps/13-9360/qca6174-firmware.nix
deleted file mode 100644
index c5da6c183280..000000000000
--- a/modules/nixos-hardware/dell/xps/13-9360/qca6174-firmware.nix
+++ /dev/null
@@ -1,26 +0,0 @@
-{ stdenv, fetchurl }:
-
-stdenv.mkDerivation rec {
-  name = "${target}-firmware-${version}";
-  version = "${branch}-00042";
-
-  branch = "4.4.1.c1";
-  target = "QCA6174";
-
-  src = fetchurl {
-    url = "https://github.com/kvalo/ath10k-firmware/raw/952afa4949cb34193040cd4e7441e1aee50ac731/${target}/hw3.0/${branch}/firmware-6.bin_RM.${version}-QCARMSWP-1";
-    sha256 = "01vvz3qhqw5l3yilcqgk1spk4y9k4qy7na7a57cbl037r231szdh";
-  };
-
-  buildCommand = ''
-    install -D $src $out/lib/firmware/ath10k/${target}/hw3.0/firmware-6.bin
-  '';
-
-  meta = with stdenv.lib; {
-    description = "Updated firmware for the qca6174 wireless chip";
-    homepage = "https://github.com/kvalo/ath10k-firmware/tree/master/QCA6174/hw3.0";
-    license = licenses.unfreeRedistributable;
-    maintainers = with maintainers; [ yorickvp ];
-    platforms = platforms.linux;
-  };
-}
diff --git a/modules/nixos-hardware/dell/xps/15-9500/README.wiki b/modules/nixos-hardware/dell/xps/15-9500/README.wiki
new file mode 100644
index 000000000000..ebcb5e315396
--- /dev/null
+++ b/modules/nixos-hardware/dell/xps/15-9500/README.wiki
@@ -0,0 +1,22 @@
+= Dell XPS 15 9550 =
+
+== Tested Hardware ==
+
+* CPU: Intel(R) Core(TM) i7-10875H CPU @ 2.30GHz
+* RAM: 64 GB
+* HDD: 1 TiB SSD
+* Screen: 15" 4k (3840✕2160)
+* Graphics: NVIDIA Corporation TU117M [GeForce GTX 1650 Ti Mobile], with Intel Graphics too.
+* Input: Touchscreen and trackpad.
+
+== Notes ==
+
+Also tested with Dell WD19TB Thunderbolt Dock.
+
+== NVIDIA Offload ==
+
+In order to run a program on the NVIDIA gpu, you can use the `nvidia-offload` function, for example:
+```
+nvidia-offload `nix-shell -p glxinfo --run 'glxgears'`
+```
+This is a short bash script that sets the proper environment variables and calls your command.
diff --git a/modules/nixos-hardware/dell/xps/15-9500/default.nix b/modules/nixos-hardware/dell/xps/15-9500/default.nix
new file mode 100644
index 000000000000..c7beda4d558e
--- /dev/null
+++ b/modules/nixos-hardware/dell/xps/15-9500/default.nix
@@ -0,0 +1,21 @@
+{ lib, ... }:
+let
+  thermald-conf = ./thermald-conf.xml;
+in
+{
+  imports = [
+    ../../../common/cpu/intel
+    ../../../common/pc/laptop
+    ../../../common/pc/laptop/ssd
+  ];
+
+  # Boot loader
+  boot.kernelParams = lib.mkDefault [ "acpi_rev_override" ];
+
+  # This will save you money and possibly your life!
+  services.thermald.enable = lib.mkDefault true;
+
+  # Thermald doesn't have a default config for the 9500 yet, the one in this repo
+  # was generated with dptfxtract-static (https://github.com/intel/dptfxtract)
+  services.thermald.configFile = lib.mkDefault thermald-conf;
+}
diff --git a/modules/nixos-hardware/dell/xps/15-9500/nvidia/default.nix b/modules/nixos-hardware/dell/xps/15-9500/nvidia/default.nix
new file mode 100644
index 000000000000..451b6eb75315
--- /dev/null
+++ b/modules/nixos-hardware/dell/xps/15-9500/nvidia/default.nix
@@ -0,0 +1,15 @@
+{ lib, pkgs, ... }:
+{
+  imports = [
+    ../default.nix
+    ../../../../common/gpu/nvidia.nix
+  ];
+
+  hardware.nvidia.prime = {
+    # Bus ID of the Intel GPU.
+    intelBusId = lib.mkDefault "PCI:0:2:0";
+
+    # Bus ID of the NVIDIA GPU.
+    nvidiaBusId = lib.mkDefault "PCI:1:0:0";
+  };
+}
diff --git a/modules/nixos-hardware/dell/xps/15-9500/thermald-conf.xml b/modules/nixos-hardware/dell/xps/15-9500/thermald-conf.xml
new file mode 100644
index 000000000000..bc13d3541dcb
--- /dev/null
+++ b/modules/nixos-hardware/dell/xps/15-9500/thermald-conf.xml
@@ -0,0 +1,205 @@
+<?xml version="1.0"?> 
+ <!-- BEGIN --> 
+ <ThermalConfiguration> 
+ <Platform>
+	<Name> Auto generated </Name>
+	<ProductName>XPS 15 9500</ProductName>
+	<Preference>QUIET</Preference>
+	<PPCC>
+		<PowerLimitIndex>0</PowerLimitIndex>
+		<PowerLimitMinimum>10000</PowerLimitMinimum>
+		<PowerLimitMaximum>68000</PowerLimitMaximum>
+		<TimeWindowMinimum>56000</TimeWindowMinimum>
+		<TimeWindowMaximum>56000</TimeWindowMaximum>
+		<StepSize>250</StepSize>
+	</PPCC>
+	<ThermalZones>
+		<ThermalZone>
+			<Type>auto_zone_0</Type>
+			<TripPoints>
+				<TripPoint>
+					<SensorType>SEN2</SensorType>
+					<Temperature>55000</Temperature>
+					<Type>Passive</Type>
+					<CoolingDevice>
+						<Type>B0D4</Type>
+						<SamplingPeriod>1</SamplingPeriod>
+						<TargetState>45000000</TargetState>
+					</CoolingDevice>
+				</TripPoint>
+				<TripPoint>
+					<SensorType>SEN2</SensorType>
+					<Temperature>57000</Temperature>
+					<Type>Passive</Type>
+					<CoolingDevice>
+						<Type>B0D4</Type>
+						<SamplingPeriod>1</SamplingPeriod>
+						<TargetState>40000000</TargetState>
+					</CoolingDevice>
+				</TripPoint>
+				<TripPoint>
+					<SensorType>SEN2</SensorType>
+					<Temperature>60000</Temperature>
+					<Type>Passive</Type>
+					<CoolingDevice>
+						<Type>B0D4</Type>
+						<SamplingPeriod>1</SamplingPeriod>
+						<TargetState>35000000</TargetState>
+					</CoolingDevice>
+				</TripPoint>
+				<TripPoint>
+					<SensorType>SEN2</SensorType>
+					<Temperature>64000</Temperature>
+					<Type>Passive</Type>
+					<CoolingDevice>
+						<Type>B0D4</Type>
+						<SamplingPeriod>3</SamplingPeriod>
+						<TargetState>35000000</TargetState>
+					</CoolingDevice>
+				</TripPoint>
+				<TripPoint>
+					<SensorType>SEN2</SensorType>
+					<Temperature>68000</Temperature>
+					<Type>Passive</Type>
+					<CoolingDevice>
+						<Type>B0D4</Type>
+						<SamplingPeriod>3</SamplingPeriod>
+						<TargetState>20000000</TargetState>
+					</CoolingDevice>
+				</TripPoint>
+				<TripPoint>
+					<SensorType>SEN2</SensorType>
+					<Temperature>70000</Temperature>
+					<Type>Passive</Type>
+					<CoolingDevice>
+						<Type>B0D4</Type>
+						<SamplingPeriod>3</SamplingPeriod>
+						<TargetState>15000000</TargetState>
+					</CoolingDevice>
+				</TripPoint>
+			</TripPoints>
+		</ThermalZone>
+		<ThermalZone>
+			<Type>auto_zone_1</Type>
+			<TripPoints>
+				<TripPoint>
+					<SensorType>SEN5</SensorType>
+					<Temperature>38000</Temperature>
+					<Type>Passive</Type>
+					<CoolingDevice>
+						<Type>B0D4</Type>
+						<SamplingPeriod>1</SamplingPeriod>
+						<TargetState>22000000</TargetState>
+					</CoolingDevice>
+				</TripPoint>
+				<TripPoint>
+					<SensorType>SEN5</SensorType>
+					<Temperature>39000</Temperature>
+					<Type>Passive</Type>
+					<CoolingDevice>
+						<Type>B0D4</Type>
+						<SamplingPeriod>1</SamplingPeriod>
+						<TargetState>17000000</TargetState>
+					</CoolingDevice>
+				</TripPoint>
+				<TripPoint>
+					<SensorType>SEN5</SensorType>
+					<Temperature>40000</Temperature>
+					<Type>Passive</Type>
+					<CoolingDevice>
+						<Type>B0D4</Type>
+						<SamplingPeriod>3</SamplingPeriod>
+						<TargetState>12000000</TargetState>
+					</CoolingDevice>
+				</TripPoint>
+				<TripPoint>
+					<SensorType>SEN5</SensorType>
+					<Temperature>41000</Temperature>
+					<Type>Passive</Type>
+					<CoolingDevice>
+						<Type>B0D4</Type>
+						<SamplingPeriod>3</SamplingPeriod>
+					</CoolingDevice>
+				</TripPoint>
+			</TripPoints>
+		</ThermalZone>
+		<ThermalZone>
+			<Type>auto_zone_2</Type>
+			<TripPoints>
+				<TripPoint>
+					<SensorType>VIR1</SensorType>
+					<Temperature>57000</Temperature>
+					<Type>Passive</Type>
+					<CoolingDevice>
+						<Type>B0D4</Type>
+						<SamplingPeriod>3</SamplingPeriod>
+						<TargetState>15000000</TargetState>
+					</CoolingDevice>
+				</TripPoint>
+				<TripPoint>
+					<SensorType>VIR1</SensorType>
+					<Temperature>60000</Temperature>
+					<Type>Passive</Type>
+					<CoolingDevice>
+						<Type>B0D4</Type>
+						<SamplingPeriod>3</SamplingPeriod>
+					</CoolingDevice>
+				</TripPoint>
+			</TripPoints>
+		</ThermalZone>
+		<ThermalZone>
+			<Type>auto_zone_3</Type>
+			<TripPoints>
+				<TripPoint>
+					<SensorType>VIR2</SensorType>
+					<Temperature>76000</Temperature>
+					<Type>Passive</Type>
+					<CoolingDevice>
+						<Type>B0D4</Type>
+						<SamplingPeriod>1</SamplingPeriod>
+					</CoolingDevice>
+				</TripPoint>
+			</TripPoints>
+		</ThermalZone>
+		<ThermalZone>
+			<Type>auto_zone_4</Type>
+			<TripPoints>
+				<TripPoint>
+					<SensorType>WRLS</SensorType>
+					<Temperature>80000</Temperature>
+					<Type>Passive</Type>
+					<CoolingDevice>
+						<Type>B0D4</Type>
+						<SamplingPeriod>1</SamplingPeriod>
+					</CoolingDevice>
+				</TripPoint>
+			</TripPoints>
+		</ThermalZone>
+		<ThermalZone>
+			<Type>auto_zone_5</Type>
+			<TripPoints>
+				<TripPoint>
+					<SensorType>STG1</SensorType>
+					<Temperature>66000</Temperature>
+					<Type>Passive</Type>
+					<CoolingDevice>
+						<Type>B0D4</Type>
+						<SamplingPeriod>1</SamplingPeriod>
+						<TargetState>19000000</TargetState>
+					</CoolingDevice>
+				</TripPoint>
+				<TripPoint>
+					<SensorType>STG1</SensorType>
+					<Temperature>90000</Temperature>
+					<Type>Passive</Type>
+					<CoolingDevice>
+						<Type>B0D4</Type>
+						<SamplingPeriod>1</SamplingPeriod>
+					</CoolingDevice>
+				</TripPoint>
+			</TripPoints>
+		</ThermalZone>
+	</ThermalZones>
+</Platform>
+</ThermalConfiguration>
+<!-- END -->
diff --git a/modules/nixos-hardware/dell/xps/15-9550/README.wiki b/modules/nixos-hardware/dell/xps/15-9550/README.wiki
index c0e9158a883e..93d33ab9c6f7 100644
--- a/modules/nixos-hardware/dell/xps/15-9550/README.wiki
+++ b/modules/nixos-hardware/dell/xps/15-9550/README.wiki
@@ -5,12 +5,19 @@ Most of this I presume also applies to the XPS 13 1530, the 13" variant.
 == Tested Hardware ==
 
 * CPU: Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
-* RAM: 16 GB
+* RAM: 32 GB
 * HDD: 512 GiB SSD
 * Screen: 15" 4k (3840✕2160)
 * Graphics: NVIDIA Corporation GM107M, with Intel Graphics too.
 * Input: Touchscreen and trackpad.
 
+== NVIDIA Offload ==
+
+In order to run a program on the NVIDIA gpu, you can use the `nvidia-offload` function, for example:
+```
+nvidia-offload `nix-shell -p glxinfo --run 'glxgears'`
+```
+This is a short bash script that sets the proper environment variables and calls your command.
 
 == Firmware Configuration ==
 
diff --git a/modules/nixos-hardware/dell/xps/15-9550/nvidia/default.nix b/modules/nixos-hardware/dell/xps/15-9550/nvidia/default.nix
new file mode 100644
index 000000000000..451b6eb75315
--- /dev/null
+++ b/modules/nixos-hardware/dell/xps/15-9550/nvidia/default.nix
@@ -0,0 +1,15 @@
+{ lib, pkgs, ... }:
+{
+  imports = [
+    ../default.nix
+    ../../../../common/gpu/nvidia.nix
+  ];
+
+  hardware.nvidia.prime = {
+    # Bus ID of the Intel GPU.
+    intelBusId = lib.mkDefault "PCI:0:2:0";
+
+    # Bus ID of the NVIDIA GPU.
+    nvidiaBusId = lib.mkDefault "PCI:1:0:0";
+  };
+}