From d29bb5cbf842b92c4018e83d9e238886f9f4a930 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 17 Aug 2020 02:09:01 +0100 Subject: refactor(glittershark/chupacabra): Move boot config into a block This is kind of difficult to read otherwise because the boot configuration is scattered throughout the file. Change-Id: I8977b1bd2b9162c898c96aa249c40749b3d46180 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1762 Tested-by: BuildkiteCI Reviewed-by: glittershark --- .../system/system/machines/chupacabra.nix | 29 ++++++++++++++-------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'users/glittershark') diff --git a/users/glittershark/system/system/machines/chupacabra.nix b/users/glittershark/system/system/machines/chupacabra.nix index cd77e48e337b..5e9fb5795330 100644 --- a/users/glittershark/system/system/machines/chupacabra.nix +++ b/users/glittershark/system/system/machines/chupacabra.nix @@ -24,16 +24,31 @@ thresholdPercentage = 5; }; - boot.initrd.luks.devices."cryptswap".device = "/dev/disk/by-uuid/3b6e2fd4-bfe9-4392-a6e0-4f3b3b76e019"; + boot = { + blacklistedKernelModules = [ "nouveau" "intel" ]; + extraModulePackages = [ ]; + + initrd = { + availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; + kernelModules = [ ]; + + luks.devices = { + "cryptroot".device = "/dev/disk/by-uuid/c2fc7ce7-a45e-48a1-8cde-be966ef601db"; + "cryptswap".device = "/dev/disk/by-uuid/3b6e2fd4-bfe9-4392-a6e0-4f3b3b76e019"; + }; + }; + + kernel.sysctl."vm.swappiness" = 1; + kernelModules = [ "kvm-intel" ]; + kernelParams = [ "acpi_rev_override" ]; + }; - boot.kernelParams = [ "acpi_rev_override" ]; services.thermald.enable = true; hardware.cpu.intel.updateMicrocode = true; # Intel-only graphics hardware.nvidiaOptimus.disable = true; - boot.blacklistedKernelModules = [ "nouveau" "intel" ]; services.xserver.videoDrivers = [ "intel" ]; # Nvidia Optimus (hybrid) - currently not working @@ -55,18 +70,11 @@ # From hardware-configuration.nix - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; - fileSystems."/" = { device = "/dev/mapper/cryptroot"; fsType = "ext4"; }; - boot.initrd.luks.devices."cryptroot".device = "/dev/disk/by-uuid/c2fc7ce7-a45e-48a1-8cde-be966ef601db"; - fileSystems."/boot" = { device = "/dev/disk/by-uuid/3492-9E3A"; fsType = "vfat"; @@ -83,7 +91,6 @@ # from nixos-hardware TODO sort this around services.tlp.enable = true; - boot.kernel.sysctl."vm.swappiness" = 1; services.fstrim.enable = lib.mkDefault true; # Intel cpu stuff -- cgit 1.4.1