From 43ff2173d97eaa1188f5ca2d6c371942f8715cc5 Mon Sep 17 00:00:00 2001 From: Sebastian Schulze Date: Thu, 1 Jun 2023 16:59:22 +0200 Subject: [PATCH] [nixos] Refactor boot config into distinct hardware groups --- dot_config/nixos/boot.nix | 8 -------- dot_config/nixos/flake.nix | 2 ++ dot_config/nixos/futros.nix | 11 +++++++++++ dot_config/nixos/thinkpads.nix | 8 ++++++++ 4 files changed, 21 insertions(+), 8 deletions(-) create mode 100644 dot_config/nixos/futros.nix diff --git a/dot_config/nixos/boot.nix b/dot_config/nixos/boot.nix index 5d55cf1..05d2caa 100644 --- a/dot_config/nixos/boot.nix +++ b/dot_config/nixos/boot.nix @@ -4,15 +4,7 @@ imports = [ ]; config = { boot.initrd.luks.reusePassphrases = true; - boot.initrd.availableKernelModules = [ "nvme" "ehci_pci" "xhci_pci" "usbhid" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" "amdgpu" ]; - boot.initrd.kernelModules = [ "dm-snapshot" "amdgpu" ]; boot.kernelModules = [ "kvm-amd" "v4l2loopback" ]; - boot.extraModulePackages = with config.boot.kernelPackages - ; [ v4l2loopback ]; - boot.extraModprobeConfig = '' - options v4l2loopback devices=2 video_nr=8,9 card_label="Wayland 8,Wayland 9" exclusive_caps=1 - ''; - boot.kernel.sysctl = { "fs.inotify.max_user_watches" = "1310720"; "fs.inotify.max_user_instances" = "8192"; diff --git a/dot_config/nixos/flake.nix b/dot_config/nixos/flake.nix index 52b9242..674d36e 100644 --- a/dot_config/nixos/flake.nix +++ b/dot_config/nixos/flake.nix @@ -42,6 +42,7 @@ system = "x86_64-linux"; modules = [ ./configuration.nix + ./futros.nix ./boot.nix ./network.nix ./security.nix @@ -53,6 +54,7 @@ system = "x86_64-linux"; modules = [ ./configuration.nix + ./futros.nix ./scanberry.nix ./boot.nix ./network.nix diff --git a/dot_config/nixos/futros.nix b/dot_config/nixos/futros.nix new file mode 100644 index 0000000..1f9aab9 --- /dev/null +++ b/dot_config/nixos/futros.nix @@ -0,0 +1,11 @@ +{ config, pkgs, lib, ... }: + +{ + imports = [ ]; + config = { + boot.initrd.availableKernelModules = [ "r8169" "nvme" "ehci_pci" "xhci_pci" "usbhid" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" "amdgpu" ]; + boot.initrd.kernelModules = [ "dm-snapshot" "r8169"]; + + + }; +} diff --git a/dot_config/nixos/thinkpads.nix b/dot_config/nixos/thinkpads.nix index 65bbda6..c991323 100644 --- a/dot_config/nixos/thinkpads.nix +++ b/dot_config/nixos/thinkpads.nix @@ -3,6 +3,14 @@ { imports = [ ]; config = { + boot.initrd.availableKernelModules = [ "nvme" "ehci_pci" "xhci_pci" "usbhid" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" "amdgpu" ]; + boot.initrd.kernelModules = [ "dm-snapshot" "amdgpu" ]; + boot.kernelModules = [ "kvm-amd" "v4l2loopback" ]; + boot.extraModulePackages = with config.boot.kernelPackages + ; [ v4l2loopback ]; + boot.extraModprobeConfig = '' + options v4l2loopback devices=2 video_nr=8,9 card_label="Wayland 8,Wayland 9" exclusive_caps=1 + ''; sound.enable = true; hardware.keyboard.zsa.enable = true; hardware.logitech.wireless.enable = true;