NH v4 Announcement

Hello again :wave:

@notashelf and I, along with all the NH contributors, want to present the latest version of NH. (It’s been a while since 4.0 was pushed into nixpkgs, but we never did an announcement).

As a refresher, NH is a CLI tool that rewrites some NixOS commands, improving ergonomics and user experience. For example, nh os switch is the nixos-rebuild equivalent, but it shows a tree of all builds, which packages are upgraded, and asks for confirmation. Check the readme and don’t forget to give us a star :star: GitHub - nix-community/nh: Yet another Nix CLI helper. [Maintainers=@viperML, @NotAShelf]

Notable features for v4:

  • Added support for Nix-Darwin with the new nh darwin {switch, repl} commands.
  • Support for any installable; NH is now not flake-only (e.g. nh os switch -f ./config.nix).
  • Remote deployments with nh os --target-host.
  • Update flake inputs with --update.
  • List the system’s generations with nh os info.
  • Rollback your system with nh os rollback.
  • NH is now a nix-community project; you are invited to contribute to this humble Rust project.
  • Many bug fixes and improvements.

You can try it now directly from nixpkgs: nix shell nixpkgs#nh. If you have any questions or suggestions, please let us know :+1:

40 Likes

I’ve been using this for NixOS! :pray:

I love nh, and am still dreaming of support for a nh os --build-host parameter. :relieved:

--build-host does exist.

It doesn’t show up in nh os build --help :thinking:

error: unrecognised flag '--build-host'

Maybe you’re using an older version?

brisingr@manin ~> nh --version
nh 4.1.1
brisingr@manin ~> nh os build --build-host
error: a value is required for '--build-host <BUILD_HOST>' but none was supplied

For more information, try '--help'.
brisingr@manin ~ [2]> 
1 Like

You are absolutely right! In my nixcfg directory, nh was pinned was locked to 4.0.0 by devenv, while I have nh 4.1.1! Thank you very much!

1 Like