From 6abeea70e9dac328159a9ba4d6f0d84c5c3a2387 Mon Sep 17 00:00:00 2001 From: Qyriad Date: Mon, 29 Apr 2024 08:15:52 -0600 Subject: [PATCH] docs: give translation examples from nix-build -E/-A to installables Change-Id: I03f4c7c1049063539a35ba500a07bb8f866d4cb7 --- src/nix/nix.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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