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

RFC: lib: Add utility to define help-annotated attrsets #68126

Closed
wants to merge 1 commit into from

Conversation

@3noch
Copy link
Contributor

3noch commented Sep 5, 2019

RFC: Add simple utilities to allow help-documentation for attrsets, most useful for nix-build -A ....

This makes it easy to add documentation to a default.nix such that nix-build -A help gives you a description of all your build targets.

@3noch 3noch requested review from edolstra and nbp as code owners Sep 5, 2019
@3noch

This comment has been minimized.

Copy link
Contributor Author

3noch commented Sep 5, 2019

@3noch

This comment has been minimized.

Copy link
Contributor Author

3noch commented Sep 5, 2019

I don't know why this would cause a rebuild of anything...

@3noch 3noch force-pushed the 3noch:eac@add-command-line-help-utils branch from 3886e92 to e28dbe5 Sep 5, 2019
@Infinisil

This comment has been minimized.

Copy link
Member

Infinisil commented Sep 5, 2019

As already indicated on IRC, I don't think this fits in nixpkgs and I'd rather see this in something like NUR or Flakes in the future. I think nixpkgs' lib should mainly be reserved for things used in nixpkgs itself.

While I did previously mention how I wouldn't mind nixpkgs being used as a standard library, I think this function is a bit too non-standard for this.

Nixpkgs is also already a too big centralized piece of bloat, adding random functions to it wouldn't help with that. I wouldn't want nixpkgs to become a dumping ground for all kind of unrelated functionality.

@3noch

This comment has been minimized.

Copy link
Contributor Author

3noch commented Sep 5, 2019

@Infinisil I hear you. I don't see this as "random functionality" though and I'm curious if there are others who agree with me, hence the PR. I see this almost as "missing feature from nix-build" so therefore it should be ubiquitous.

@3noch

This comment has been minimized.

Copy link
Contributor Author

3noch commented Sep 5, 2019

(I also wonder if mapAttrsNestedRecursiveCond might deserve a home in lib.attrsets though...)

@3noch 3noch force-pushed the 3noch:eac@add-command-line-help-utils branch from e28dbe5 to 0c60c10 Sep 5, 2019
@3noch

This comment has been minimized.

Copy link
Contributor Author

3noch commented Sep 7, 2019

I've convinced myself that this feature set is non-trivial enough that it either a) justifies a real package in nixpkgs or b) doesn't justify one because there are many ways to implement it.

For now I've started a repo which expands a great deal on this PR with more features: https://github.com/3noch/help.nix

@danbst

This comment has been minimized.

Copy link
Contributor

danbst commented Feb 14, 2020

It's nice you've extracted this to separate package! Please publish your package in https://nixos.wiki/wiki/Applications, so it is visible. Maybe it fits a separate section "lib extensions"

@danbst danbst closed this Feb 14, 2020
@3noch 3noch deleted the 3noch:eac@add-command-line-help-utils branch Feb 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.