Files
lix/doc/manual/rl-next/print-derivations.md
T
Lunaphied f3b2f3496b repl: allow :p to print derivation attrs.
Change-Id: I6a6a6964a58c3340acca9272c616c079c5218d6e
2025-11-19 17:46:52 +01:00

1.0 KiB

synopsis, cls, category, credits
synopsis cls category credits
Derivations can now be printed in detail in `nix repl`
3842
Improvements
Lunaphied

Traditionally derivations printed in the REPL would only print a formatted object representing the path of the derivation file it refers to. This makes inspecting the enhanced derivation attribute sets encountered from mkDerivation or similar wrappers more difficult. Even the :p/:print command would not elaborate attribute sets tagged as a derivation.

With this change you can now use :p/:print to directly inspect a derivation by providing one as the top-level object. Derivation attribute sets will only be printed two levels deep and internal derivation attrsets will remain in unexpanded path form as before. drvAttrs will also be elided as these attributes are already present in the top-level attribute set of the derivation. These heuristics provide a balance between readability and functionality. When the :p/:print is omitted, a bare derivation is printed in the path format as before.