about summary refs log tree commit diff
path: root/users/wpcarro/nixos/tarasco/default.nix
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2022-05-27T22·27-0700
committerclbot <clbot@tvl.fyi>2022-05-27T23·27+0000
commit3dbfa04f217814b9de7994356a718ea03ec4b92d (patch)
tree68474c4fc01e169d84edcd849fbb14e6022c05f0 /users/wpcarro/nixos/tarasco/default.nix
parent8adf2c374008bc07171815421337f6cb3ec5778a (diff)
fix(wpcarro/tarasco): Blacklist rtw88_8821ce r/4160
This naughty RealTek wireless module crashes my machine. I'm also moving other
`boot`-prefixed options out of `hardware.nix` and into `default.nix`. In
general, I'm not *really* a fan of the distinction between the two files in the
first place.

Change-Id: Iabdc776afc78f00971f426c5931b7235c8c0ee20
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5747
Tested-by: BuildkiteCI
Reviewed-by: wpcarro <wpcarro@gmail.com>
Autosubmit: wpcarro <wpcarro@gmail.com>
Diffstat (limited to 'users/wpcarro/nixos/tarasco/default.nix')
-rw-r--r--users/wpcarro/nixos/tarasco/default.nix35
1 files changed, 29 insertions, 6 deletions
diff --git a/users/wpcarro/nixos/tarasco/default.nix b/users/wpcarro/nixos/tarasco/default.nix
index 55db69e68be1..c8b2d02356a1 100644
--- a/users/wpcarro/nixos/tarasco/default.nix
+++ b/users/wpcarro/nixos/tarasco/default.nix
@@ -20,12 +20,34 @@ in
   # Use the TVL binary cache
   tvl.cache.enable = true;
 
-  boot.loader.systemd-boot.enable = true;
-  boot.loader.efi.canTouchEfiVariables = true;
+  boot = {
+    loader.systemd-boot.enable = true;
+    loader.efi.canTouchEfiVariables = true;
+
+    # Support IP forwarding to use this device as a Tailscale exit node.
+    kernel.sysctl."net.ipv4.ip_forward" = true;
+    kernel.sysctl."net.ipv6.conf.all.forwarding" = true;
+    kernelModules = [
+      "kvm-intel"
+    ];
+
+    # Can verify these settings with:
+    # $ lsmod
+    # ...or:
+    # $ cat /etc/modprobe.d/nixos.conf
+    blacklistedKernelModules = [
+      # Disabling this buggy network driver (and preferring ethernet) to prevent
+      # my machine from becoming unresponsive.
+      # TODO(wpcarro): Consider replacing this module with this fork (if NixOS
+      # isn't already): https://github.com/tomaspinho/rtl8821ce
+      "rtw88_8821ce"
+    ];
+
+    initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
+    initrd.kernelModules = [ ];
+    extraModulePackages = [ ];
+  };
 
-  # Support IP forwarding to use this device as a Tailscale exit node.
-  boot.kernel.sysctl."net.ipv4.ip_forward" = true;
-  boot.kernel.sysctl."net.ipv6.conf.all.forwarding" = true;
 
   time.timeZone = "America/Los_Angeles";
 
@@ -35,7 +57,8 @@ in
     networkmanager.enable = true;
     interfaces.enp1s0.useDHCP = true;
     interfaces.enp3s0.useDHCP = true;
-    # Disabling wifi because the Realtek network card drivers crash.
+    # Disabling wifi because the Realtek network card drivers crash. For more
+    # context, see the boot.blacklistedKernelModules configuration.
     # interfaces.wlp2s0.useDHCP = true;
   };