From 33f6419d7efb777884c7c44dc2f00216fbd4191f Mon Sep 17 00:00:00 2001 From: William Carroll Date: Tue, 5 Jul 2022 09:43:52 -0700 Subject: refactor(wpcarro/nixos): Define shared nopn.nix module Shared between `ava` and `tarasco`. Also define `lib/default.nix` to share utility functions like `usermod` between NixOS configurations. Change-Id: I65b8d37520426e164c9d5f722bee4731a3c6e641 Reviewed-on: https://cl.tvl.fyi/c/depot/+/5942 Tested-by: BuildkiteCI Reviewed-by: wpcarro Autosubmit: wpcarro --- users/wpcarro/nixos/modules/hardware/nopn.nix | 52 +++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 users/wpcarro/nixos/modules/hardware/nopn.nix (limited to 'users/wpcarro/nixos/modules') diff --git a/users/wpcarro/nixos/modules/hardware/nopn.nix b/users/wpcarro/nixos/modules/hardware/nopn.nix new file mode 100644 index 000000000000..7733f5331ba6 --- /dev/null +++ b/users/wpcarro/nixos/modules/hardware/nopn.nix @@ -0,0 +1,52 @@ +# I tried looking up the manufacturer, product name, and version, but +# `dmidecode -t system` reported "To be filled by O.E.M." for each of these +# fields. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; + + fileSystems."/" = { + device = "/dev/disk/by-label/NIXROOT"; + fsType = "ext4"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-label/NIXBOOT"; + fsType = "vfat"; + }; + + boot = { + initrd.availableKernelModules = [ + "xhci_pci" + "ehci_pci" + "ahci" + "usb_storage" + "usbhid" + "sd_mod" + ]; + initrd.kernelModules = [ ]; + kernelModules = [ "kvm-intel" ]; + extraModulePackages = [ ]; + + # 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" + ]; + }; + + swapDevices = [ ]; + + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + # high-resolution display + hardware.video.hidpi.enable = lib.mkDefault true; +} -- cgit 1.4.1