nixos-config/modules/boot.nix

28 lines
752 B
Nix
Raw Normal View History

2021-01-21 22:13:53 +04:00
{ lib, pkgs, config, ... }: {
boot = {
2021-01-22 21:44:23 +04:00
loader = {
timeout = 1;
} // (if config.deviceSpecific.devInfo.legacy or false then { # Non-UEFI config
grub.enable = true;
grub.version = 2;
grub.useOSProber = true;
grub.device = "/dev/sda";
} else { # UEFI config
systemd-boot.enable = true;
});
2021-01-22 00:19:07 +04:00
kernelParams = [ "quiet" "scsi_mod.use_blk_mq=1" "modeset" "nofb" ]
2021-01-22 21:44:23 +04:00
++ lib.optionals (pkgs.system == "x86_64-linux") [
2021-01-22 00:19:07 +04:00
"rd.systemd.show_status=auto"
"rd.udev.log_priority=3"
"pti=off"
"spectre_v2=off"
];
2021-01-21 22:13:53 +04:00
kernelPackages = pkgs.linuxPackages_latest;
consoleLogLevel = 3;
kernel.sysctl."vm.swappiness" = 0;
kernel.sysctl."kernel/sysrq" = 1;
};
}