Skip to content

Commit db00265

Browse files
simplify note on lazy attribute access (#1127)
1 parent 3ddcd50 commit db00265

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

source/tutorials/packaging-existing-software.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ To search derivations on the command line, use `nix-locate` from the [`nix-index
504504

505505
### Adding package sets as dependencies
506506

507-
Add this to your derivation's input attribute set and to `buildInputs`:
507+
Add `xorg` to your derivation's input attribute set and use `xorg.libX11` in `buildInputs`:
508508

509509
```nix
510510
# icat.nix
@@ -531,9 +531,7 @@ stdenv.mkDerivation {
531531
```
532532

533533
:::{note}
534-
Only add the top-level `xorg` derivation to the input attrset, rather than the full `xorg.libX11`, as the latter would cause a syntax error.
535-
536-
Because Nix is lazily-evaluated, using `xorg.libX11` means that we only include the `libX11` attribute and the derivation doesn't actually include all of `xorg` into the build context.
534+
Because the Nix language is lazily evaluated, accessing only `xorg.libX11` means that the remaining contents of the `xorg` attribute set are never processed.
537535
:::
538536

539537
## Fixing build failures

0 commit comments

Comments
 (0)