Announcing NH 4.2.0

Hello all,

I’m excited to announce the release of NH 4.2.0! This release brings a plethora of improvements, user-requested features and bugfixes across the board to make your NH experience even smoother.
(Nixpkgs PR open merged)

Highlights

  • More Powerful and Flexible Updates: The --update-input flag can now be specified multiple times, and no longer requires --update. Both are now mutually exclusive for clarity.

  • Enhanced Diffing: The switch from nvd to dix means package diffs are now faster and more reliable. Plus, there’s a new --diff flag to control when diffs are shown (auto, always, never).

  • Manpages Now Available: NH now ships with manpages! If your package vendor provides them, you’ll have quick access with man 1 nh. The manpages contain helpful examples and more elaborate command reference that you would normally refer to the README for

  • Better Privilege Escalation : NH tries alternative methods (doas, run0, and fallback pkexec) if sudo isn’t available, and now properly prompts for your password during remote deploys. This has been a long-requested feature and thanks to @henriquekirchheck it has been made available in 4.2.0 :slight_smile:

  • Improved Error Handling and Debugging: Debug output is more verbose (stackable -v flags), and error/context messages have been upgraded throughout NH.

  • Darwin Improvements: nh darwin switch now shows the full output from darwin-rebuild, for clearer activation handling

  • Faster and Smarter Cleaning: nh clean skips missing directories gracefully and is ~4% faster on average. Thank you @khaneliman for this.

Fixes

  • Version Handling
    NH now properly detects non-semver version strings and skips checks with a warning instead of failing.

  • More Informative Errors
    Disabling system.switch now provides a more descriptive error message.

  • Environment Isolation
    Environment variables passed to commands are now carefully selected, fixing issues like “$HOME is not owned by you!`” (#314).

  • Activation Race Condition
    Fixed a tempdir race that could cause activation failures (#386).

Full Changelog

For a detailed list of all changes, additions, and fixes in 4.2.0, see the CHANGELOG.


Thank you everyone who has contributed to and tested this release. This release would not be possibe without the many contributors that submitted bug reports, PRs or simply discussed NH. I appreciate all of you, and as always, please report any issues or feedback on GitHub.

Happy Nixxing

- NotAShelf

35 Likes

Thanks for making nixos-rebuild logs enjoyable.

edit: My thanks are not limited to NotAShelf. Other people involved, directly or otherwise, thank you to you as well.

2 Likes