nix-config/config/basic/boot.nix

31 lines
937 B
Nix
Raw Normal View History

2023-09-11 00:21:02 +02:00
{
config,
lib,
2023-09-20 21:49:49 +02:00
pkgs,
2023-09-11 00:21:02 +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;
emergencyAccess = config.secrets.secrets.global.users.root.passwordHash;
2023-09-20 21:49:49 +02:00
extraBin.ip = "${pkgs.iproute}/bin/ip";
2024-03-02 16:09:11 +01:00
extraBin.cryptsetup = "${pkgs.cryptsetup}/bin/cryptsetup";
users.root.shell = "${pkgs.bashInteractive}/bin/bash";
storePaths = ["${pkgs.bashInteractive}/bin/bash"];
2023-09-11 00:21:02 +02:00
};
2023-10-10 18:37:55 +02:00
initrd.availableKernelModules = ["xhci_pci" "nvme" "r8169" "usb_storage" "usbhid" "sd_mod" "rtsx_pci_sdmmc" "ahci" "uas" "tpm_crb"];
2023-09-11 00:21:02 +02:00
supportedFilesystems = ["ntfs"];
kernelModules = ["kvm-intel"];
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;
};
}