Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
5a40f5e
systemctl hints
NotAShelf Nov 12, 2025
2b665ee
Merge branch 'master' into nh-feature-parity
NotAShelf Nov 12, 2025
057b61e
Merge branch 'master' into nh-feature-parity
NotAShelf Nov 17, 2025
bbcd0b5
Merge branch 'master' into nh-feature-parity
NotAShelf Nov 19, 2025
4500360
Merge branch 'master' into nh-feature-parity
NotAShelf Nov 22, 2025
1e0b395
nixos: defer to Eyre for error wrapping
NotAShelf Nov 22, 2025
a20657b
interface: distinguish between rebuild-only and rebuild-and-activate …
NotAShelf Nov 22, 2025
8e41d84
docs: update CHANGELOG
NotAShelf Nov 22, 2025
f8b4094
docs: update README; reorder sections and rewrite attributions
NotAShelf Nov 22, 2025
673bca5
chore: format manifest with Taplo
NotAShelf Nov 22, 2025
817e4b2
nh: remove completion generation from main CLI
NotAShelf Nov 22, 2025
c4ef484
meta: move shell completion generation to cargo-xtask
NotAShelf Nov 23, 2025
c7e367a
nixos: move BuildVm to no-activate group
NotAShelf Nov 23, 2025
59e580f
nix: simplify postInstall
NotAShelf Nov 23, 2025
c354ce0
xtask: format with Taplo
NotAShelf Nov 23, 2025
32d12a9
docs: fix typo in README
NotAShelf Nov 23, 2025
a73e4bc
xtask: improve error handling and remove dead code
NotAShelf Nov 23, 2025
c3df836
docs: update changelogs
NotAShelf Nov 23, 2025
90abbfa
nix: fix completion output dir
NotAShelf Nov 23, 2025
a70b03e
nixos: derive label for error `Test` & `Switch` variants
NotAShelf Nov 23, 2025
e0ec54f
xtask: replace manual error handling with proper `Result` propagation
NotAShelf Nov 23, 2025
9f1dedd
darwin: fix command names in errors and directory names
NotAShelf Nov 23, 2025
d80f165
nixos: show activation logs only when `--show-systemctl-hints` is passed
NotAShelf Nov 23, 2025
aa80793
nix: get rid of `installShellFiles` helper; use plain `cp`
NotAShelf Nov 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,10 @@ pub struct OsRebuildArgs {
/// Build the configuration to a different host over ssh
#[arg(long)]
pub build_host: Option<String>,

/// Show systemctl debugging hints when systemd services fail
#[arg(long, env = "NH_SHOW_SYSTEMCTL_HINTS")]
pub show_systemctl_hints: bool,
}

impl OsRebuildArgs {
Expand Down
15 changes: 14 additions & 1 deletion src/nixos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -370,8 +370,21 @@ impl OsRebuildArgs {
.elevate(elevate.then_some(elevation.clone()))
.preserve_envs(["NIXOS_INSTALL_BOOTLOADER"])
.with_required_env()
.show_output(true)
.run()
.wrap_err("Activation (test) failed")?;
.map_err(|e| {
let error_str = e.to_string();
let mut enhanced =
format!("Activation (test) failed\n\nError: {}", error_str);

if error_str.contains("units failed") && self.show_systemctl_hints {
enhanced.push_str("\n\nTo investigate failed services:");
enhanced.push_str("\n systemctl --failed");
enhanced.push_str("\n journalctl -xe -u <service-name>");
}

eyre!(enhanced)
})?;

debug!("Completed {variant:?} operation with output path: {out_path:?}");
}
Expand Down
Loading