[Nix#9380] Allow custom printing in nix repl #99
Labels
No labels
Area/build-packaging
Area/cli
Area/evaluator
Area/fetching
Area/flakes
Area/language
Area/profiles
Area/protocol
Area/releng
Area/remote-builds
Area/repl
Area/store
bug
crash 💥
Cross Compilation
devx
docs
Downstream Dependents
E/easy
E/hard
E/help wanted
E/reproducible
E/requires rearchitecture
imported
Needs Langver
OS/Linux
OS/macOS
performance
regression
release-blocker
RFD
stability
Status
blocked
Status
invalid
Status
postponed
Status
wontfix
testing
testing/flakey
ux
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lix-project/lix#99
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Upstream-Issue: NixOS/nix#9380
Is your feature request related to a problem? Please describe.
Sometimes there are attribute sets with a public interface but an internal structure, which when passed to
nix repl
currently print their internal structure by default. A good example is thelib.fileset
library:Related to that: Nixpkgs derivations are currently always printed as their
.drv
:When really, there's a lot more to the interface of a package than just its
.drv
, things likepassthru
,meta
,.override
attributes, etc. (notably not all attributes).Describe the solution you'd like
A special attribute like
__nixReplShowString
, which defines a__toString
-like function. When an attribute set with such an attribute gets passed to the REPL, instead of printing it recursively, it should just evaluate that attribute and print the resulting string:This should take precedence over the existing derivation printing, such that Nixpkgs can customise it more.
Describe alternatives you've considered
Additional context
This issue is sponsored by Antithesis ✨
Priorities
Add 👍 to issues you find important.