Skip to content

Commit

Permalink
Document common options in stable nix binaries (NixOS#11663)
Browse files Browse the repository at this point in the history
  • Loading branch information
tfc authored Oct 10, 2024
1 parent 4db9487 commit 39da946
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions doc/manual/src/command-ref/opt-common.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<!-- Some of the options documented here are hardcopied from
src/libcmd/common-eval-args.cc
-->

# Common Options

Most Nix commands accept the following command-line options:
Expand Down Expand Up @@ -161,6 +165,14 @@ Most Nix commands accept the following command-line options:
You can override this using `--arg`, e.g., `nix-env --install --attr pkgname --arg system \"i686-freebsd\"`.
(Note that since the argument is a Nix string literal, you have to escape the quotes.)

- <span id="opt-arg-from-file">[`--arg-from-file`](#opt-arg-from-file)</span> *name* *path*

Pass the contents of file *path* as the argument *name* to Nix functions.

- <span id="opt-arg-from-stdin">[`--arg-from-stdin`](#opt-arg-from-stdin)</span> *name*

Pass the contents of stdin as the argument *name* to Nix functions.

- <span id="opt-argstr">[`--argstr`](#opt-argstr)</span> *name* *value*

This option is like `--arg`, only the value is not a Nix expression but a string.
Expand All @@ -179,6 +191,10 @@ Most Nix commands accept the following command-line options:
attribute of the fourth element of the array in the `foo` attribute
of the top-level expression.

- <span id="opt-eval-store">[`--eval-store`](#opt-eval-store)</span> *store-url*

The [URL to the Nix store](@docroot@/store/types/index.md#store-url-format) to use for evaluation, i.e. where to store derivations (`.drv` files) and inputs referenced by them.

- <span id="opt-expr">[`--expr`](#opt-expr)</span> / `-E`

Interpret the command line arguments as a list of Nix expressions to be parsed and evaluated, rather than as a list of file names of Nix expressions.
Expand All @@ -194,6 +210,10 @@ Most Nix commands accept the following command-line options:

Paths added through `-I` take precedence over the [`nix-path` configuration setting](@docroot@/command-ref/conf-file.md#conf-nix-path) and the [`NIX_PATH` environment variable](@docroot@/command-ref/env-common.md#env-NIX_PATH).

- <span id="opt-impure">[`--impure`](#opt-impure)</span>

Allow access to mutable paths and repositories.

- <span id="opt-option">[`--option`](#opt-option)</span> *name* *value*

Set the Nix configuration option *name* to *value*.
Expand Down

0 comments on commit 39da946

Please sign in to comment.