#!/usr/bin/env sh # G-06 (config: check/fmt) + G-07 (status/info/doctor/boot/log/diff) validation, # run inside the VM on the current golden (no flakes/formatter needed except fmt, # which is expected to surface a missing-tool finding). Creates one extra # generation so diff/history have something to compare. set -u N=/root/nina echo "KILN_CS_BEGIN" # Make a 2nd generation so diff/log have content. sed -i 's| ./hardware-configuration.nix | ./hardware-configuration.nix ./genmarker.nix |' /etc/nixos/configuration.nix printf '{ ... }: { environment.etc."nina-gen".text = "X"; }\n' > /etc/nixos/genmarker.nix $N apply >/dev/null 2>&1; echo "setup apply rc=$?" echo "### G-06 T-082 nina check (valid config; expect :: ok, exit 0)" $N check; echo "CHECK_RC=$?" echo "### G-06 T-084 nina fmt (expect format /etc/nixos/configuration.nix)" $N fmt; echo "FMT_RC=$?" echo "### G-06 T-085 nina fmt --check (expect ok after fmt)" $N fmt --check; echo "FMTCHK_RC=$?" echo "### G-07 T-090 nina status" $N status; echo "STATUS_RC=$?" echo "### G-07 T-096 nina info (expect nixos version, kernel, uptime)" $N info; echo "INFO_RC=$?" echo "### G-07 T-094 nina doctor" $N doctor; echo "DOCTOR_RC=$?" echo "### G-07 T-097 nina boot (expect boot entries, current marked)" $N boot; echo "BOOT_RC=$?" echo "### G-07 T-093 nina log (expect operation history)" $N log; echo "LOG_RC=$?" echo "### G-07 T-091 nina diff (expect gen N -> N+1 changes)" $N diff; echo "DIFF_RC=$?" echo "KILN_CS_END"