{ config, hostPkgs, lib, ... }: let sitePkg = hostPkgs.runCommand "site" { } '' dist=$out/dist mkdir -p $dist echo "foo" > $dist/index.html echo "index" > $dist/foo.html ''; check = config.node.pkgs.testers.lycheeLinkCheck { site = sitePkg; }; in { name = "testers-lychee-link-check-run"; nodes.client = { ... }: { }; nodes.example = { networking.firewall.allowedTCPPorts = [ 80 ]; services.nginx = { enable = true; virtualHosts."example" = { locations."/" = { root = "/var/www/example"; index = "index.html"; }; }; }; }; testScript = '' start_all() # SETUP example.succeed(""" mkdir -p /var/www/example echo '

hi

' > /var/www/example/index.html """) client.wait_until_succeeds(""" curl --fail -v http://example """) # FAILURE CASE client.succeed(""" exec 1>&2 r=0 ${lib.getExe check.online} || { r=$? } if [[ $r -ne 2 ]]; then echo "lycheeLinkCheck unexpected exit code $r" exit 1 fi """) # SUCCESS CASE example.succeed(""" echo '

foo

' > /var/www/example/foo.html """) client.succeed(""" ${lib.getExe check.online} """) ''; }