Options (7)
-q, --querybooleanList all installed packages
Example:
nix-env {{[-q|--query]}}booleanQuery available packages from the Nixpkgs registry
Example:
nix-env {{[-qa|--query --available]}} {{search_pattern}}booleanInstall a package from the Nixpkgs registry
Example:
nix-env {{[-iA|--install --attr]}} nixpkgs.{{pkg_name}}-i, --installbooleanInstall a package from a custom URL
Example:
nix-env {{[-i|--install]}} {{pkg_name}} {{[-f|--file]}} {{example.com}}-f, --filebooleanInstall a package from a custom URL
Example:
nix-env {{[-i|--install]}} {{pkg_name}} {{[-f|--file]}} {{example.com}}-e, --uninstallbooleanUninstall a package
Example:
nix-env {{[-e|--uninstall]}} {{pkg_name}}-u, --upgradebooleanUpgrade 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_patternQuery available packages from the Nixpkgs registry
nix-env [-qa|--query --available] search_patternInstall a package from the Nixpkgs registry
nix-env [-iA|--install --attr] nixpkgs.pkg_nameInstall a package from a custom URL
nix-env [-i|--install] pkg_name [-f|--file] example.comUninstall a package
nix-env [-e|--uninstall] pkg_nameUpgrade a package
nix-env [-u|--upgrade] pkg_nameGet usage help for a specific operation (`--install`, `--upgrade`, etc.)
nix-env --help --option_namemade by @shridhargupta | data from tldr-pages