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

Generate Gleam types from nixpkgs? #7

Open
evelant opened this issue Jun 12, 2024 · 3 comments
Open

Generate Gleam types from nixpkgs? #7

evelant opened this issue Jun 12, 2024 · 3 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@evelant
Copy link

evelant commented Jun 12, 2024

This may be a naive question, but might it be possible to generate Gleam types for the entire nixpkgs package set and nixos/home-manager/nix-darwin option set? That could be a "killer" feature, having type checking and autocomplete for nixpkgs and options. Obviously the result would be pretty large but if it could be generated automatically on a regular basis I think it would probably work fine as package names and options don't usually change very fast after they're defined in nixpkgs.

@evelant
Copy link
Author

evelant commented Jun 12, 2024

Given that documentation for nixos/home-manager/nix-darwin/nixpkgs gets generated from their respective nix sources it seems this would probably be possible. I'm just not sure how feasible it is.

edit: could probably adapt something like this https://gitlab.com/rycee/nmd/ or the nixos make-options-doc https://github.com/NixOS/nixpkgs/blob/master/nixos/lib/make-options-doc/default.nix

@PgBiel
Copy link
Member

PgBiel commented Jun 12, 2024

Yup! This is definitely something I want to make possible. Open to any suggestions and/or contributions here.

Thanks for the links! Will be taking a look as well.

@PgBiel PgBiel added enhancement New feature or request help wanted Extra attention is needed labels Jun 12, 2024
@evelant
Copy link
Author

evelant commented Jun 12, 2024

A quick look at make-options-doc and I see that it can already output JSON. Depending on what sort of type information can be extracted from that it might be fairly straightforward!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants