about summary refs log tree commit diff
path: root/modules/nixos-hardware/dell
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-01-07 16:23:40 +0000
committerAlyssa Ross <hi@alyssa.is>2019-01-07 16:24:02 +0000
commit8c0790eb6095ef59a9623596f5794d250b95c699 (patch)
tree4801e46054b433e786e15d030b6cab991d8a6724 /modules/nixos-hardware/dell
parent36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2 (diff)
parent99cdc883064ac5a1b9e189d3500a809616e79765 (diff)
downloadnixlib-8c0790eb6095ef59a9623596f5794d250b95c699.tar
nixlib-8c0790eb6095ef59a9623596f5794d250b95c699.tar.gz
nixlib-8c0790eb6095ef59a9623596f5794d250b95c699.tar.bz2
nixlib-8c0790eb6095ef59a9623596f5794d250b95c699.tar.lz
nixlib-8c0790eb6095ef59a9623596f5794d250b95c699.tar.xz
nixlib-8c0790eb6095ef59a9623596f5794d250b95c699.tar.zst
nixlib-8c0790eb6095ef59a9623596f5794d250b95c699.zip
Add 'modules/nixos-hardware/' from commit '99cdc883064ac5a1b9e189d3500a809616e79765'
git-subtree-dir: modules/nixos-hardware
git-subtree-mainline: 36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2
git-subtree-split: 99cdc883064ac5a1b9e189d3500a809616e79765
Diffstat (limited to 'modules/nixos-hardware/dell')
-rw-r--r--modules/nixos-hardware/dell/xps/13-9360/default.nix26
-rw-r--r--modules/nixos-hardware/dell/xps/13-9360/qca6174-firmware.nix26
-rw-r--r--modules/nixos-hardware/dell/xps/13-9370/README.wiki16
-rw-r--r--modules/nixos-hardware/dell/xps/13-9370/default.nix16
-rw-r--r--modules/nixos-hardware/dell/xps/15-9550/README.wiki52
-rw-r--r--modules/nixos-hardware/dell/xps/15-9550/default.nix15
6 files changed, 151 insertions, 0 deletions
diff --git a/modules/nixos-hardware/dell/xps/13-9360/default.nix b/modules/nixos-hardware/dell/xps/13-9360/default.nix
new file mode 100644
index 000000000000..e13e758d44c7
--- /dev/null
+++ b/modules/nixos-hardware/dell/xps/13-9360/default.nix
@@ -0,0 +1,26 @@
+{ lib, pkgs, ... }:
+
+{
+  imports = [
+    ../../../common/cpu/intel/kaby-lake
+    ../../../common/pc/laptop
+  ];
+
+  boot.blacklistedKernelModules = [ "psmouse" ]; # touchpad goes over i2c
+
+  # TODO: decide on boot loader policy
+  boot.loader = {
+    efi.canTouchEfiVariables = lib.mkDefault true;
+    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 {};
+  })];
+}
diff --git a/modules/nixos-hardware/dell/xps/13-9360/qca6174-firmware.nix b/modules/nixos-hardware/dell/xps/13-9360/qca6174-firmware.nix
new file mode 100644
index 000000000000..c5da6c183280
--- /dev/null
+++ b/modules/nixos-hardware/dell/xps/13-9360/qca6174-firmware.nix
@@ -0,0 +1,26 @@
+{ 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/13-9370/README.wiki b/modules/nixos-hardware/dell/xps/13-9370/README.wiki
new file mode 100644
index 000000000000..57b5e08d3850
--- /dev/null
+++ b/modules/nixos-hardware/dell/xps/13-9370/README.wiki
@@ -0,0 +1,16 @@
+= Dell XPS 13 9370 =
+
+== Battery drain when sleeping ==
+
+The laptop uses the S2 sleep mode by default instead of S3, which leads to
+draining a lot of battery during sleep.
+
+Though this is intentional by the manufacturer and might cause lockups when
+forced  I - @moredread - never had any issues with it.
+
+See https://wiki.archlinux.org/index.php/Dell_XPS_13_(9370)#Power_Management
+and https://bugzilla.kernel.org/show_bug.cgi?id=199689#c3 for reference
+
+== Additional resources ==
+
+* Arch linux wiki: [https://wiki.archlinux.org/index.php/Dell_XPS_13_(9370) Dell XPS 13 9370]
diff --git a/modules/nixos-hardware/dell/xps/13-9370/default.nix b/modules/nixos-hardware/dell/xps/13-9370/default.nix
new file mode 100644
index 000000000000..cd53acd02fc0
--- /dev/null
+++ b/modules/nixos-hardware/dell/xps/13-9370/default.nix
@@ -0,0 +1,16 @@
+{ lib, pkgs, ... }:
+
+{
+  imports = [
+    ../../../common/cpu/intel/kaby-lake
+    ../../../common/pc/laptop
+    ../../../common/pc/laptop/acpi_call.nix
+    ../../../common/pc/laptop/cpu-throttling-bug.nix
+  ];
+
+  # Force S3 sleep mode. See README.wiki for details.
+  boot.kernelParams = [ "mem_sleep_default=deep" ];
+
+  # touchpad goes over i2c
+  boot.blacklistedKernelModules = [ "psmouse" ];
+}
diff --git a/modules/nixos-hardware/dell/xps/15-9550/README.wiki b/modules/nixos-hardware/dell/xps/15-9550/README.wiki
new file mode 100644
index 000000000000..c0e9158a883e
--- /dev/null
+++ b/modules/nixos-hardware/dell/xps/15-9550/README.wiki
@@ -0,0 +1,52 @@
+= Dell XPS 15 9550 =
+
+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
+* HDD: 512 GiB SSD
+* Screen: 15" 4k (3840✕2160)
+* Graphics: NVIDIA Corporation GM107M, with Intel Graphics too.
+* Input: Touchscreen and trackpad.
+
+
+== Firmware Configuration ==
+
+Not much tweaking of NixOS itself was needed. But we currently cannot automate the firmware setup, so this must be done by hand.
+
+=== Before installation ===
+
+These settings are needed both for booting the final install, and installer itself. Therefore, they must be done first.
+
+* ''Disable Secure Boot (but keep UEFI Boot).'' Thakfully doing so is as easy as changing any other simple setting.
+
+* ''Disable Intel hardware RAID and use AHCI instead.'' Intel doesn't seem to provide a working linux driver for this.  (If you just have SSD it's pointless and just slows things down needlessly anyways.)
+
+
+=== After installation ===
+
+* ''Add systemd-boot to UEFI boot list.'' The (uneditable anyways) settings mapping drive UUIDs to HD* work fine.
+
+=== Optional ===
+
+* ''Disable C-States.'' This is a processor idling thing. It seems to cause random crashes (Blank screen, no normal panic debug dump). Unfortunately, without it, the computer cannot be suspended. On the other hand, it doesn't seem to affect acpi's estimation of battery life when the computer is running with minimal load, but I haven't tested battery life in practice. I list it as optional as there's a tradeoff, and the crashes are rare enough one can probably get through installation just fine.
+
+* ''Update BIOS.'' According to Reddit, this helps with battery life.
+
+* ''Update Intel's Thunderbolt firmware.'' Without this, the Thunderbolt port will only work as power source, and not transfer data.
+
+=== Troubleshooting ===
+
+==== rcu_sched freezing problems ====
+
+After a recent update my machine became unstable. X couldn't start and even running `lspci` would lock the machine. I'm not sure what the root cause was, but I found the fix here: https://wiki.archlinux.org/index.php/Dell_XPS_15_9560#Troubleshooting
+
+TL;DR I added this line:
+
+```
+boot.kernelParams = [ "acpi_rev_override=1" "pcie_aspm=off" "nouveau.modeset=0" ];
+```
+
+Some more detail about the problem can be found here: https://bbs.archlinux.org/viewtopic.php?id=223056
diff --git a/modules/nixos-hardware/dell/xps/15-9550/default.nix b/modules/nixos-hardware/dell/xps/15-9550/default.nix
new file mode 100644
index 000000000000..90cfc6e2936a
--- /dev/null
+++ b/modules/nixos-hardware/dell/xps/15-9550/default.nix
@@ -0,0 +1,15 @@
+{ lib, ... }:
+
+{
+  imports = [
+    ../../../common/cpu/intel
+    ../../../common/pc/laptop
+  ];
+
+  # TODO: boot loader
+  boot.loader.systemd-boot.enable = lib.mkDefault true;
+  boot.loader.efi.canTouchEfiVariables = lib.mkDefault true;
+
+  # To just use Intel integrated graphics with Intel's open source driver
+  # hardware.nvidiaOptimus.disable = true;
+}