nix-config/config/basic/boot.nix

44 lines
1,001 B
Nix
Raw Permalink Normal View History

2023-09-11 00:21:02 +02:00
{
config,
lib,
2023-09-20 21:49:49 +02:00
pkgs,
2024-12-20 20:40:27 +01:00
globals,
2023-09-11 00:21:02 +02:00
...
2024-07-26 22:12:48 +02:00
}:
{
2023-12-18 02:11:24 +01:00
boot = lib.mkIf (!config.boot.isContainer) {
2023-09-11 00:21:02 +02:00
initrd.systemd = {
enable = true;
2024-12-20 20:40:27 +01:00
emergencyAccess = globals.users.root.hashedPassword;
2024-10-23 14:44:05 +02:00
extraBin.ip = "${pkgs.iproute2}/bin/ip";
2024-03-02 16:09:11 +01:00
extraBin.cryptsetup = "${pkgs.cryptsetup}/bin/cryptsetup";
users.root.shell = "${pkgs.bashInteractive}/bin/bash";
2024-07-26 22:12:48 +02:00
storePaths = [ "${pkgs.bashInteractive}/bin/bash" ];
2023-09-11 00:21:02 +02:00
};
2024-07-26 22:12:48 +02:00
initrd.availableKernelModules = [
"xhci_pci"
"nvme"
"r8169"
"usb_storage"
"usbhid"
"sd_mod"
"rtsx_pci_sdmmc"
"ahci"
"uas"
"tpm_crb"
];
supportedFilesystems = [ "ntfs" ];
kernelModules = [ "kvm-intel" ];
2023-09-11 00:21:02 +02:00
kernelParams = [
"rd.luks.options=timeout=0"
"rootflags=x-systemd.device-timeout=0"
2023-09-20 21:49:49 +02:00
# NOTE: Add "rd.systemd.unit=rescue.target" to debug initrd
#"rd.systemd.unit=rescue.target"
2023-09-11 00:21:02 +02:00
];
tmp.useTmpfs = true;
loader.timeout = lib.mkDefault 2;
};
}