#!/usr/bin/env bash set -euo pipefail # Woodpecker traces commands; keep the password out of its logs. set +x if [[ -z "${TRANSCRYPT_PASSWORD:-}" ]]; then TRANSCRYPT_PASSWORD=$(cat /run/nix-builder-ci-secrets/transcrypt-password) fi : "${TRANSCRYPT_PASSWORD:?Set the transcrypt_password Woodpecker secret}" transcrypt --yes --cipher=aes-256-cbc --password="$TRANSCRYPT_PASSWORD" >/dev/null unset TRANSCRYPT_PASSWORD # Discover every host so newly added configurations are automatically checked. mapfile -t hosts < <(nix eval --json .#nixosConfigurations --apply builtins.attrNames | python3 -c 'import json,sys; print("\n".join(json.load(sys.stdin)))') test "${#hosts[@]}" -gt 0 root_dir=/var/lib/nix-ci for host in "${hosts[@]}"; do echo "Building $host" # A stable symlink per host retains its last successful closure across GC. # Nix registers these out-links as indirect GC roots. nix build --no-update-lock-file --print-build-logs \ --out-link "$root_dir/$host" \ ".#nixosConfigurations.\"$host\".config.system.build.toplevel" done