infrastructure/nixos/hosts/thalassa/null/rescue-boot.nix

36 lines
911 B
Nix
Raw Normal View History

2022-10-08 21:38:55 +02:00
{ pkgs, ... }:
let
2022-10-08 21:54:52 +02:00
# TODO: slim down size
2022-10-08 21:38:55 +02:00
netboot = import (pkgs.path + "/nixos/lib/eval-config.nix") {
inherit (pkgs) system;
modules = [
(pkgs.path + "/nixos/modules/installer/netboot/netboot-minimal.nix")
module
];
};
module = {
system.stateVersion = "22.11";
boot.supportedFilesystems = [ "btrfs" "ext4" ];
2023-05-04 13:08:10 +02:00
environment.systemPackages = with pkgs; [ git ];
2022-10-08 21:38:55 +02:00
};
2023-09-25 11:56:02 +02:00
in
{
2022-10-08 21:38:55 +02:00
boot.loader.systemd-boot = {
extraEntries = {
"rescue.conf" = ''
title Rescue Boot
linux /rescue-kernel
initrd /rescue-initrd
2023-05-04 13:08:10 +02:00
options init=${netboot.config.system.build.toplevel}/init ${
toString netboot.config.boot.kernelParams
}
2022-10-08 21:38:55 +02:00
'';
};
extraFiles = {
"rescue-kernel" = "${netboot.config.system.build.kernel}/bzImage";
"rescue-initrd" = "${netboot.config.system.build.netbootRamdisk}/initrd";
};
};
}