commands.sh

nh

all

Modern helper utility tool for the Nix/NixOS ecosystem. Some subcommands such as `os`, `home`, `clean`, `search` have their own usage documentation.

More info →

Options (2)

-H, --hostnameboolean

Build and switch to a nix-darwin flake configuration

Example: nh darwin switch {{path/to/flake}} {{[-H|--hostname]}} {{host}}
-a, --askboolean

Collect all garbage and gcroots from the Nix store

Example: nh clean all {{[-a|--ask]}}

Examples (6)

Build and switch to a specified NixOS flake configuration

nh os switch path/to/flake

Build and switch to a specified Home Manager flake configuration

nh home switch path/to/flake

Build and switch to a nix-darwin flake configuration

nh darwin switch path/to/flake [-H|--hostname] host

Collect all garbage and gcroots from the Nix store

nh clean all [-a|--ask]

Search for a package in Nixpkgs

Generate shell completions for a specified shell

nh completions shell
made by @shridhargupta | data from tldr-pages