diff options
Diffstat (limited to 'src/nix')
-rw-r--r-- | src/nix/nix.md | 12 |
1 files changed, 12 insertions, 0 deletions
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 '<nixpkgs>' -A hello` pattern, use: + +```console +$ nix build -f '<nixpkgs>' hello +``` + ### Nix expression Example: `--expr 'import <nixpkgs> {}' 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 `<nixpkgs>`). +To emulate the `nix-build -E 'with import <nixpkgs> { }; hello' pattern use: + +```console +$ nix build --impure -E 'with import <nixpkgs> { }; hello' +``` + ## Derivation output selection Derivations can have multiple outputs, each corresponding to a |