infrastructure/nixos/hosts/thalassa/null/rescue-boot.nix
Victor 2c16870d66
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
nixfmt
2023-05-04 13:08:10 +02:00

34 lines
911 B
Nix

{ pkgs, ... }:
let
# TODO: slim down size
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" ];
environment.systemPackages = with pkgs; [ git ];
};
in {
boot.loader.systemd-boot = {
extraEntries = {
"rescue.conf" = ''
title Rescue Boot
linux /rescue-kernel
initrd /rescue-initrd
options init=${netboot.config.system.build.toplevel}/init ${
toString netboot.config.boot.kernelParams
}
'';
};
extraFiles = {
"rescue-kernel" = "${netboot.config.system.build.kernel}/bzImage";
"rescue-initrd" = "${netboot.config.system.build.netbootRamdisk}/initrd";
};
};
}