Home Explore Blog Models CI



nix

doc/manual/source/command-ref/nix-env/opt-common.md
b407d9695df34a7cc678c17a3cee49ebc2deb54465ce1091000000030000061c
# Options

The following options are allowed for all `nix-env` operations, but may not always have an effect.

- `--file` / `-f` *path*

  Specifies the Nix expression (designated below as the *active Nix
  expression*) used by the `--install`, `--upgrade`, and `--query
  --available` operations to obtain derivations. The default is
  `~/.nix-defexpr`.

  If the argument starts with `http://` or `https://`, it is
  interpreted as the URL of a tarball that will be downloaded and
  unpacked to a temporary location. The tarball must include a single
  top-level directory containing at least a file named `default.nix`.

- `--profile` / `-p` *path*

  Specifies the profile to be used by those operations that operate on
  a profile (designated below as the *active profile*). A profile is a
  sequence of user environments called *generations*, one of which is
  the *current generation*.

- `--dry-run`

  For the `--install`, `--upgrade`, `--uninstall`,
  `--switch-generation`, `--delete-generations` and `--rollback`
  operations, this flag will cause `nix-env` to print what *would* be
  done if this flag had not been specified, without actually doing it.

  `--dry-run` also prints out which paths will be
  [substituted](@docroot@/glossary.md) (i.e., downloaded) and which paths
  will be built from source (because no substitute is available).

- `--system-filter` *system*

  By default, operations such as `--query --available` show derivations matching any platform. This option
  allows you to use derivations for the specified platform *system*.

Chunks
2ef936a2 (1st chunk of `doc/manual/source/command-ref/nix-env/opt-common.md`)
Title: nix-env Global Options
Summary
This document outlines several command-line options applicable to all `nix-env` operations. The `--file` (`-f`) option specifies the Nix expression to obtain derivations, defaulting to `~/.nix-defexpr` and supporting local paths or tarball URLs. The `--profile` (`-p`) option selects the user profile (a sequence of generations) for operations that modify it. `--dry-run` simulates various operations (e.g., install, upgrade, uninstall), showing planned actions and identifying paths to be substituted or built without making actual changes. Lastly, `--system-filter` allows filtering available derivations to a specific platform system, overriding the default behavior of showing derivations for any platform.