Skip to content

Add a lib schema#15

Open
sellout wants to merge 1 commit intoDeterminateSystems:mainfrom
sellout:patch-1
Open

Add a lib schema#15
sellout wants to merge 1 commit intoDeterminateSystems:mainfrom
sellout:patch-1

Conversation

@sellout
Copy link
Contributor

@sellout sellout commented Nov 28, 2023

It recurses into attrSets, showing all the terms of the lib output.

Here's an example nix flake show:

⋮
├───lib
│   ├───configuration: lambda
│   ├───defaultConfiguration: lambda
│   └───just
│       └───some
│           └───nested
│               └───values
│                   ├───aList: list
│                   ├───aPath: path
│                   ├───aString: string
│                   ├───anInt: int
│                   └───itsNull: null
⋮

It recurses into attrSets, showing all the terms of the `lib` output.

Here's an example `nix flake show`:
```
⋮
├───lib
│   ├───configuration: lambda
│   ├───defaultConfiguration: lambda
│   └───just
│       └───some
│           └───nested
│               └───values
│                   ├───aList: list
│                   ├───aPath: path
│                   ├───aString: string
│                   ├───anInt: int
│                   └───itsNull: null
⋮
```
@edolstra
Copy link
Collaborator

Unfortunately this goes into an infinite recursion on the lib set of Nixpkgs, since it contains an self-referential attrset:

│   ├───types
│   │   ├───addCheck: lambda
│   │   ├───anything
│   │   │   ├───_type: string
│   │   │   ├───check: lambda
│   │   │   ├───deprecationMessage: null
│   │   │   ├───description: string
│   │   │   ├───descriptionClass: string
│   │   │   ├───emptyValue
│   │   │   ├───functor
│   │   │   │   ├───binOp: lambda
│   │   │   │   ├───name: string
│   │   │   │   ├───payload: null
│   │   │   │   ├───type
│   │   │   │   │   ├───_type: string
│   │   │   │   │   ├───check: lambda
│   │   │   │   │   ├───deprecationMessage: null
│   │   │   │   │   ├───description: string
│   │   │   │   │   ├───descriptionClass: string
│   │   │   │   │   ├───emptyValue
│   │   │   │   │   ├───functor
│   │   │   │   │   │   ├───binOp: lambda
│   │   │   │   │   │   ├───name: string
│   │   │   │   │   │   ├───payload: null
│   │   │   │   │   │   ├───type
│   │   │   │   │   │   │   ├───_type: string
│   │   │   │   │   │   │   ├───check: lambda
│   │   │   │   │   │   │   ├───deprecationMessage: null
│   │   │   │   │   │   │   ├───description: string
│   │   │   │   │   │   │   ├───descriptionClass: string
│   │   │   │   │   │   │   ├───emptyValue
│   │   │   │   │   │   │   ├───functor
│   │   │   │   │   │   │   │   ├───binOp: lambda

(Of course Nixpkgs could provide its own lib schema, but right now this would break nix flake show nixpkgs if we include this in the default schemas.)

@sellout
Copy link
Contributor Author

sellout commented Jul 6, 2024

What do you think is the right way to solve this? Should we support this recursion, or patch Nixpkgs to not be self-referential?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants