Immutable
release. Only release title and notes can be modified.
Added
--option NAME VALUEpassthrough flag (repeatable) for setting arbitrary Nix
configuration options per-invocation, e.g.--option sandbox false. Forwarded
to all underlyingnixcommands.--override-input INPUT FLAKE_URLpassthrough flag (repeatable) for
overriding specific flake inputs without editingflake.lock.NH_SSHOPTSenvironment variable as the NH-native alias forNIX_SSHOPTS.
NH_SSHOPTStakes precedence when both are set.NH_SUDOOPTSenvironment variable for passing extra arguments to thesudo
invocation when NH elevates privileges.NIX_SUDOOPTSis also accepted for
nixos-rebuild compatibility, withNH_SUDOOPTStaking precedence.NIXOS_NO_CHECKis now forwarded toswitch-to-configurationduring
activation, matching nixos-rebuild behaviour.nh search offline <query>subcommand for offline search using
spam-db databases. Requires-D <path>(or
NH_OFFLINE_DB) pointing to the database directory.nh search prs <query>subcommand for searching recent Nixpkgs pull requests
and showing which Nixpkgs branches merged PRs have reached. Numeric queries
and#<number>fetch that pull request directly.nh search issues <query>subcommand for searching recent Nixpkgs issues
while excluding pull requests.nh search prsreads GitHub authentication fromGH_TOKENfirst, then checks
$XDG_STATE_HOME/nh/github-tokenfor a token file, falling back to
~/.local/state/nh/github-token.nh search --default-searchglobal option to set default search mode
(packagesoroptions) when no subcommand is specified.nh clean --keep-onepreserves all active direnv gcroots regardless of
--keep-since, preventing projects from being collected when they haven't
been activated recently. Orphaned and broken gcroots are still removed.nh clean --cross-filesystems/-xallows the gcroot scan to cross
filesystem boundaries. By default the walk stays on the same filesystem as
/nix/var/nix/gcroots.--no-direnvpassed tonh clean allwill now preserve.direnv/paths as
well.- Quoted attribute paths like
foo."bar.baz"are now allowed. Malformed quoted
attributes return validation errors instead of outright panicking. nh os {boot,build,switch}now supports diffing on remote machines.- nh now has an in-house
nix-commandcrate, which is used for building typed
nixos commands.nix-commandis also
published to crates.io.
Changed
- Breaking Change:
nh searchCLI has been restructured to use subcommands.--options <query>is nownh search options <query>--optionsflag has been removed--jsonis shared by all search modes, while--channel,--limit, and
--platformsnow appear only on search modes that use them- When no subcommand is specified, the default search mode is used
(configurable via--default-search)
nh searchnow uses search backend version 48 (previously 46) to track the
current Elasticsearch endpoint.- gcroot scanning now walks all of
/nix/var/nix/gcrootsrecursively instead of
only the flat/nix/var/nix/gcroots/autodirectory. - Orphaned gcroots where entries in
/nix/var/nix/gcrootswhose target symlink
no longer exists on disk were silently skipped. They are now detected and
tagged for removal. - Broken gcroots where symlinks whose
/nix/storetarget has already been
collected were also silently skipped. They are now tagged for removal
unconditionally, bypassing--keep-since. RESULT_REGEX(.*result.*) matched any path containing the word "result",
including unrelated files. It is replaced by a structural check that only
matches direct children of/nix/store.- Explicit local flake refs are now checked by nh before Nix runs. Local flake
refs like.,./foo,/path/to/flakeorpath:/some/pathmust point at a
directory containing aflake.nix. Directories where a parent directory
contains a flake are no longer valid. - Empty/malformed flake refs are now rejected early. Exempli gratia,
NH_FLAKE="" nh os switch,nh os repl '', andnh os switch '#attr'no
longer work. NH_FLAKEnow also does flake feature detection. A command resolving its
installable fromNH_FLAKEnow also checks for the required Nix experimental
features.
Fixed
- Local
run0elevation now uses--pty-late, avoiding terminal ownership
changes can break subsequent commands. --no-build-output/-Qnow forwards--quiettonix buildinstead of
the unsupported--no-build-outputflag.- Generated Nushell completions now mark the
installableargument as a path
while keeping nh's own parser compatible with flake references. nh os switch --target-host root@hostno longer wraps the activation in
sudo --prompt= --stdinwhen the SSH user is already uid 0. The elevation
decision now probesid -uover the established ControlMaster instead of
reading the local process uid, matchingnixos-rebuildbehaviour and
unblocking sudo shims that don't accept stdin passwords (e.g.
run0-sudo-shim).- The regression introduced by the
Subprocesscrate upgrade causing various
event outputs to be printed incorrectly should now be resolved. nh os infonow batchesnix path-infocalls into a single invocation
instead of spawning one process per generation. On systems with hundreds of
generations this reduces runtime from over a minute to a few seconds.
(#636)nh os infonow uses a direct map lookup when extracting closure sizes from
nix path-infoJSON output, replacing an O(N) key scan with an O(1) lookup.
- The
indicatifspinner shown during remote closure copying has been fixed so
it renders correctly again. Hooray.
(#635)
Removed
nhno longer supportsx86_64-darwin, following Nixpkgs' decision to drop
support for that platform.