From 3dbfa04f217814b9de7994356a718ea03ec4b92d Mon Sep 17 00:00:00 2001 From: William Carroll Date: Fri, 27 May 2022 15:27:57 -0700 Subject: fix(wpcarro/tarasco): Blacklist rtw88_8821ce 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 Autosubmit: wpcarro --- users/wpcarro/nixos/tarasco/default.nix | 35 ++++++++++++++++++++++++++------ users/wpcarro/nixos/tarasco/hardware.nix | 5 ----- 2 files changed, 29 insertions(+), 11 deletions(-) diff --git a/users/wpcarro/nixos/tarasco/default.nix b/users/wpcarro/nixos/tarasco/default.nix index 55db69e68b..c8b2d02356 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; }; diff --git a/users/wpcarro/nixos/tarasco/hardware.nix b/users/wpcarro/nixos/tarasco/hardware.nix index 2c4da1a3b9..3d09b9edd8 100644 --- a/users/wpcarro/nixos/tarasco/hardware.nix +++ b/users/wpcarro/nixos/tarasco/hardware.nix @@ -6,11 +6,6 @@ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; - fileSystems."/" = { device = "/dev/disk/by-label/NIXROOT"; fsType = "ext4"; -- cgit 1.4.1