diff --git a/hosts/nfsroot/default.nix b/hosts/nfsroot/default.nix index b06f2a13..d41c5171 100644 --- a/hosts/nfsroot/default.nix +++ b/hosts/nfsroot/default.nix @@ -1,10 +1,29 @@ -{ lib, ... }: +{ config, lib, pkgs, ... }: let nfsExports = [ "var/lib/nfsroot/dacbert" "var/lib/nfsroot/riscbert" "var/lib/dump-dvb/whoopsie" ]; + + reinstallDacbert = pkgs.writeScriptBin "reinstall-dacbert" '' + SYSTEM=$(${pkgs.curl}/bin/curl -sLH "Accept: application/json" \ + https://hydra.hq.c3d2.de/job/c3d2/nix-config/dacbert/latest \ + | ${pkgs.jq}/bin/jq -er .buildoutputs.out.path + ) + BOOT=$(${pkgs.curl}/bin/curl -sLH "Accept: application/json" \ + https://hydra.hq.c3d2.de/job/c3d2/nix-config/dacbert-tftproot/latest \ + | ${pkgs.jq}/bin/jq -er .buildoutputs.out.path + ) + ${config.nix.package}/bin/nix --extra-experimental-features nix-command \ + copy \ + --from https://nix-cache.hq.c3d2.de \ + --to /var/lib/nfsroot/dacbert \ + --no-check-sigs \ + $SYSTEM $BOOT + cp /var/lib/nfsroot/dacbert/$BOOT/* /var/lib/nfsroot/dacbert/boot/ + ''; + in { imports = [ ./tftp.nix @@ -37,5 +56,7 @@ in { firewall.enable = false; }; + environment.systemPackages = [ reinstallDacbert ]; + system.stateVersion = "22.05"; }