diff --git a/src/nix/nix.md b/src/nix/nix.md index 7b2cd7b7b..65fe0c5b5 100644 --- a/src/nix/nix.md +++ b/src/nix/nix.md @@ -162,6 +162,12 @@ When the option `-f` / `--file` *path* \[*attrpath*...\] is given, installables If attribute paths are provided, commands will operate on the corresponding values accessible at these paths. The Nix expression in that file, or any selected attribute, must evaluate to a derivation. +To emulate the `nix-build '' -A hello` pattern, use: + +```console +$ nix build -f '' hello +``` + ### Nix expression Example: `--expr 'import {}' hello` @@ -172,6 +178,12 @@ The Nix expression, or any selected attribute, must evaluate to a derivation. You may need to specify `--impure` if the expression references impure inputs (such as ``). +To emulate the `nix-build -E 'with import { }; hello' pattern use: + +```console +$ nix build --impure -E 'with import { }; hello' +``` + ## Derivation output selection Derivations can have multiple outputs, each corresponding to a