2023-06-14 00:35:11 +08:00
|
|
|
{ pkgs, ... }@inputs:
|
2023-06-05 21:53:13 +08:00
|
|
|
{
|
|
|
|
config =
|
|
|
|
{
|
|
|
|
boot =
|
|
|
|
{
|
2023-06-24 13:36:40 +08:00
|
|
|
kernelPackages = inputs.pkgs.linuxPackages_xanmod_latest;
|
2023-06-17 22:30:59 +08:00
|
|
|
# initrd 里有的模块
|
2023-06-19 15:53:33 +08:00
|
|
|
# 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"
|
2023-06-18 16:15:56 +08:00
|
|
|
"nvidia_uvm" "nvme" "sr_mod" "usbhid" "usb_storage" "virtio_blk" "virtio_pci" "xhci_pci"
|
2023-06-19 15:53:33 +08:00
|
|
|
]
|
|
|
|
# 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
|
|
|
};
|
|
|
|
}
|