nfsroot: add reinstallDacbert command

This commit is contained in:
Astro 2024-02-22 17:46:37 +01:00
parent 0493339ac1
commit 172d40f960
1 changed files with 22 additions and 1 deletions

View File

@ -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";
}