NH 4.3.0
Hey all,
It is my pleasure to announce the release of NH 4.3.0 with the extensive
support of @faukah, featuring various bugfixes, new features, and code cleanup.
As we cannot cover everything new in this document, here are some of the
highlights compiled from our changelog to give you an idea of what’s new:
Highlights
-
Remote deployments:
Platform commands (nh os,nh home,nh darwin) now support SSH-based
remote builds via--build-host. The flag now uses proper remote build
semantics: derivations are copied to the remote host vianix-copy-closure,
built remotely, and results are transferred back. This matchesnixos-rebuild
behavior, and is significantly more robust than the previous implementation
where--build-hostwould use Nix’s--buildersflag inefficiently.
(#428,
#497) -
Image building:
A newnh os build-imagesubcommand for building a disk-image variant is now
available. A variant can be selected using the--image-variantflag. All
variants in theconfig.system.build.imagesattribute set are supported. -
Improved VMs:
A--runflag was added tonh os build-vm, which allows immediately
starting a built VM after the build is complete. This can be chained with
otherbuild-vmflags such as--with-bootloader. -
Even nicer diffing:
dix, the crate powering the package diff
shown after every rebuild, has seen significant work to make nh’s diffs more
informative and reliable. -
Better activation log UX:
Platform commands (nh os,nh home,nh darwin) now accept a
--show-activation-logsflag that displays activation output at the end.
While activation output is now hidden to reduce noise by default, this flag
can be used to replicate the activation behaviour fromnixos-rebuildwhere
failing units are displayed at the end.- Breaking change: Activation output is now hidden by default on Home
Manager and Darwin. The logs were previously always visible. - The flag can be set globally via the
NH_SHOW_ACTIVATION_LOGSenvironment
variable.
- Breaking change: Activation output is now hidden by default on Home
-
Better search:
nh searchdisplays a link to thepackage.nixfile on the nixpkgs GitHub,
and also fixes the existing links so that they no longer brokenly point to a
non-existent file path on Nix flake systems.
Fixes
-
Graceful out-of-sync profiles:
nh os infonow gracefully handles out-of-sync profiles. When a previous
switch failed during activation (e.g., a Systemd service failed), the profile
may be out of sync with/run/current-systemwhile in “test mode” via
switch-to-configuration test. NH now warns about this condition and displays
version info from the running system instead of failing with an error. -
Proper installable resolution:
nh now properly resolves installables, fixing issues when e.g. multiple
NH_{FLAKE,FILE,{OS,HOME_DARWIN}_FLAKE}environment variables are set. -
Better cleaning when using direnv:
Direnv caches in alternative locations (e.g.,
$XDG_CACHE_DIR/direnv/layouts) will now be detected duringnh clean.
As always, a very big thank you to everyone NH, and especially to those who took
the time to contribute NH via issues, pull requests, discussions or other means
of feedback. Special thanks to @faukah for making this release possible and his
stubborn efforts to make the codebase more maintainable. Here is to more
exciting releases.
Cheers,
- NotAShelf