36 lines
1.0 KiB
Nix
36 lines
1.0 KiB
Nix
{ tftproots, pkgs, ... }:
|
|
|
|
{
|
|
networking.firewall.enable = false;
|
|
|
|
# raspberrypi boot
|
|
services.atftpd = {
|
|
enable = true;
|
|
root =
|
|
let
|
|
netbootxyzVersion = "2.0.65";
|
|
netbootxyz_efi = pkgs.fetchurl {
|
|
url = "https://github.com/netbootxyz/netboot.xyz/releases/download/${netbootxyzVersion}/netboot.xyz.efi";
|
|
sha256 = "sha256-vF6KfLyXXU4wwm+WrGxDFpOphwO4UtPqOQkqUSquAc4=";
|
|
};
|
|
netbootxyz_kpxe = pkgs.fetchurl {
|
|
url = "https://github.com/netbootxyz/netboot.xyz/releases/download/${netbootxyzVersion}/netboot.xyz.kpxe";
|
|
sha256 = "sha256-F6uvCsBzKI/Yh2VIGzGOMbMH3ezKTGWj/mmppXWijQ0=";
|
|
};
|
|
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
|
|
'';
|
|
};
|
|
}
|