2023-01-03 03:04:24 +01:00
|
|
|
{ tftproots, pkgs, ... }:
|
2022-08-22 22:14:16 +02:00
|
|
|
|
2022-03-16 20:38:00 +01:00
|
|
|
{
|
|
|
|
networking.firewall.enable = false;
|
|
|
|
|
|
|
|
# raspberrypi boot
|
|
|
|
services.atftpd = {
|
|
|
|
enable = true;
|
2022-12-20 01:31:25 +01:00
|
|
|
root =
|
|
|
|
let
|
|
|
|
netbootxyzVersion = "2.0.65";
|
|
|
|
netbootxyz_efi = pkgs.fetchurl {
|
|
|
|
url = "https://github.com/netbootxyz/netboot.xyz/releases/download/${netbootxyzVersion}/netboot.xyz.efi";
|
2022-12-21 21:06:50 +01:00
|
|
|
sha256 = "sha256-vF6KfLyXXU4wwm+WrGxDFpOphwO4UtPqOQkqUSquAc4=";
|
2022-12-20 01:31:25 +01:00
|
|
|
};
|
|
|
|
netbootxyz_kpxe = pkgs.fetchurl {
|
|
|
|
url = "https://github.com/netbootxyz/netboot.xyz/releases/download/${netbootxyzVersion}/netboot.xyz.kpxe";
|
2022-12-21 21:06:50 +01:00
|
|
|
sha256 = "sha256-F6uvCsBzKI/Yh2VIGzGOMbMH3ezKTGWj/mmppXWijQ0=";
|
2022-12-20 01:31:25 +01:00
|
|
|
};
|
|
|
|
in
|
|
|
|
pkgs.runCommand "tftproot" { } ''
|
|
|
|
mkdir $out
|
|
|
|
|
|
|
|
# PXE for PC
|
|
|
|
ln -s ${netbootxyz_efi} $out/netboot.xyz.efi
|
|
|
|
ln -s ${netbootxyz_kpxe} $out/netboot.xyz.kpxe
|
|
|
|
|
|
|
|
# generic boot files for pis
|
|
|
|
cp -sr ${tftproots.rpi-netboot-tftproot}/* $out/
|
|
|
|
|
|
|
|
# dacbert
|
|
|
|
ln -s /var/lib/nfsroot/dacbert/boot $out/3c271952
|
|
|
|
'';
|
2022-03-16 20:38:00 +01:00
|
|
|
};
|
|
|
|
}
|