commands.sh

nix-env

all

Manipulate or query Nix user environments.

More info →

Options (7)

-q, --queryboolean

List all installed packages

Example: nix-env {{[-q|--query]}}
boolean

Query available packages from the Nixpkgs registry

Example: nix-env {{[-qa|--query --available]}} {{search_pattern}}
boolean

Install a package from the Nixpkgs registry

Example: nix-env {{[-iA|--install --attr]}} nixpkgs.{{pkg_name}}
-i, --installboolean

Install a package from a custom URL

Example: nix-env {{[-i|--install]}} {{pkg_name}} {{[-f|--file]}} {{example.com}}
-f, --fileboolean

Install a package from a custom URL

Example: nix-env {{[-i|--install]}} {{pkg_name}} {{[-f|--file]}} {{example.com}}
-e, --uninstallboolean

Uninstall a package

Example: nix-env {{[-e|--uninstall]}} {{pkg_name}}
-u, --upgradeboolean

Upgrade a package

Example: nix-env {{[-u|--upgrade]}} {{pkg_name}}

Examples (8)

List all installed packages

nix-env [-q|--query]

Query installed packages (`regex` is supported)

nix-env [-q|--query] search_pattern

Query available packages from the Nixpkgs registry

nix-env [-qa|--query --available] search_pattern

Install a package from the Nixpkgs registry

nix-env [-iA|--install --attr] nixpkgs.pkg_name

Install a package from a custom URL

nix-env [-i|--install] pkg_name [-f|--file] example.com

Uninstall a package

nix-env [-e|--uninstall] pkg_name

Upgrade a package

nix-env [-u|--upgrade] pkg_name

Get usage help for a specific operation (`--install`, `--upgrade`, etc.)

nix-env --help --option_name
made by @shridhargupta | data from tldr-pages