nix-build: serve actual nfsroot/dacbert/boot on tftp

nix-build no longer provides a prebuilt nixos for dacbert now
This commit is contained in:
Astro 2022-06-10 19:01:14 +02:00
parent ceca35caff
commit b16e7e32c7
1 changed files with 8 additions and 1 deletions

View File

@ -2,9 +2,10 @@
let
tftpRoot = pkgs.runCommand "tftproot" {} ''
mkdir $out
cp -sr ${tftproots.rpi-netboot-tftproot}/* $out/
${lib.concatMapStrings (host: ''
ln -s ${tftproots."${host}-tftproot"} $out/${hostRegistry.hosts.${host}.serial}
ln -s /var/lib/nfsroot/dacbert/boot $out/${hostRegistry.hosts.${host}.serial}
'') (
builtins.attrNames (
lib.filterAttrs (_: { serial ? null, ... }: serial != null)
@ -16,6 +17,12 @@ in
{
networking.firewall.enable = false;
fileSystems."/var/lib/nfsroot/dacbert" = {
device = "${hostRegistry.hosts.nfsroot.ip4}:/var/lib/nfsroot/dacbert";
fsType = "nfs";
options = [ "nfsvers=3" "proto=tcp" "nolock" "soft" "async" "ro" ];
};
# raspberrypi boot
services.atftpd = {
enable = true;