Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a lib schema #15

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

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