network/nix/nixos-module/container/netboot.nix

18 lines
417 B
Nix

{ lib, pkgs, ... }:
let
netboot_xyz = pkgs.fetchurl {
url = "https://github.com/netbootxyz/netboot.xyz/releases/download/2.0.40/netboot.xyz.kpxe";
sha256 = "1crkr995i1hv3q548gx2xan1ymxmzcnr7mxaf77s2410mpqfcx82";
};
tftpRoot = pkgs.runCommand "tftproot" {} ''
mkdir -p $out
ln -s ${netboot_xyz} $out/netboot.xyz.kpxe
'';
in
{
services.tftpd = {
enable = true;
path = tftpRoot;
};
}