nixos/modules/boot/chn-PC.nix

42 lines
1.2 KiB
Nix
Raw Normal View History

{ pkgs, ... }@inputs:
2023-06-05 21:53:13 +08:00
{
config =
{
boot =
{
2023-06-24 12:09:49 +08:00
kernelPackages = inputs.pkgs.linuxPackages_xanmod;
2023-06-17 22:30:59 +08:00
# initrd 里有的模块
# modprobe --show-depends
2023-06-09 21:09:52 +08:00
initrd.availableKernelModules =
[
2023-06-19 14:40:12 +08:00
"ahci" "bfq" "i915" "intel_cstate" "nls_cp437" "nls_iso8859-1" "nvidia" "nvidia_drm" "nvidia_modeset"
"nvidia_uvm" "nvme" "sr_mod" "usbhid" "usb_storage" "virtio_blk" "virtio_pci" "xhci_pci"
]
# speed up luks decryption
++ [ "aesni_intel" "cryptd" "crypto_simd" "libaes" ];
2023-06-17 22:30:59 +08:00
# stage2 中自动加载的模块
kernelModules = [ "kvm-intel" "br_netfilter" ];
# 只安装,不需要自动加载的模块
# extraModulePackages = [ yourmodulename ];
extraModprobeConfig =
''
options kvm_intel nested=1
options iwlmvm power_scheme=1
options iwlwifi uapsd_disable=1
'';
2023-06-19 12:02:45 +08:00
kernelParams = [ "delayacct" "acpi_osi=Linux" "resume_offset=41696016" ];
2023-06-09 21:09:52 +08:00
resumeDevice = "/dev/mapper/root";
2023-06-05 21:53:13 +08:00
};
hardware.cpu.intel.updateMicrocode = true;
2023-06-19 14:40:12 +08:00
services.udev.extraRules =
''
ACTION=="add|change", KERNEL=="[sv]d[a-z]", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="bfq"
ACTION=="add|change", KERNEL=="nvme[0-9]n[0-9]", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="bfq"
'';
2023-06-05 21:53:13 +08:00
};
}