rebuild-nexus: print evaluation warnings once, not twice #62

Closed
opened 2026-09-19 22:07:18 +01:00 by allod-agent · 0 comments
Member

rebuild-nexus prints every Home Manager evaluation warning twice: once from its own nix eval of the toplevel, and again when nixos-rebuild evaluates the same attribute. On a host whose profile emits a dozen warnings, the first wall lands between the Attribute: and Toplevel: lines, which is exactly where the preview the script exists to show should be easy to read.

Capture the eval's stderr and print it only when the eval fails. On success the same warnings arrive from nixos-rebuild moments later, so nothing is lost; on failure the operator still sees the full error. The Flake:, Attribute: and Toplevel: lines should then print as three adjacent lines.

Validation

  • tests/rebuild-nexus.sh: with a nix stub that writes a warning to stderr and succeeds, the script's output contains the three preview lines and not the warning; with a stub that writes to stderr and fails, the script exits non-zero, the stderr text appears in its output, and the recorder is not invoked.

Scope

In: scripts/rebuild-nexus, its test. Out: the warnings themselves, which are fixed in archetypes and profiles.

Refs allod/nexus#59.

`rebuild-nexus` prints every Home Manager evaluation warning twice: once from its own `nix eval` of the toplevel, and again when `nixos-rebuild` evaluates the same attribute. On a host whose profile emits a dozen warnings, the first wall lands between the `Attribute:` and `Toplevel:` lines, which is exactly where the preview the script exists to show should be easy to read. Capture the eval's stderr and print it only when the eval fails. On success the same warnings arrive from `nixos-rebuild` moments later, so nothing is lost; on failure the operator still sees the full error. The `Flake:`, `Attribute:` and `Toplevel:` lines should then print as three adjacent lines. ### Validation - `tests/rebuild-nexus.sh`: with a `nix` stub that writes a warning to stderr and succeeds, the script's output contains the three preview lines and not the warning; with a stub that writes to stderr and fails, the script exits non-zero, the stderr text appears in its output, and the recorder is not invoked. ### Scope In: `scripts/rebuild-nexus`, its test. Out: the warnings themselves, which are fixed in archetypes and profiles. Refs allod/nexus#59.
vnprc closed this issue 2026-09-19 23:36:29 +01:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
allod/nexus#62
No description provided.