Uh oh!
There was an error while loading. Please reload this page.
Refactor commands - #297
Conversation
d035c0d to
945a241Comparezimbatm
commented
Jan 14, 2024
thanks, LGTM but just needs a rebase |
deemp
commented
Jan 14, 2024
Rebased |
| # TODO: handle opt.relatedPackages. What is it for? | ||
| optToMd = opt: | ||
| let heading = lib.showOption opt.loc; in | ||
| let heading = (lib.showOption (filter isString opt.loc)) + (concatStrings (filter (x: !(isString x)) opt.loc)); in |
There was a problem hiding this comment.
nit: the surrounding parenthesis is not needed
| ```console | ||
| (package or string convertible to it) or (list with two elements of types: [ string (package or string convertible to it) ]) or (flatOptions) | ||
| ``` |
There was a problem hiding this comment.
For flake-parts users, this mix of types would make it hard to merge commands coming from different places. I would rather keep either the list, or the attrset of commands, but not both.
Let's keep things simple.
There was a problem hiding this comment.
flake-parts
I had no problems with flake-parts. See repro. May require nix flake update.
type of commands
I couldn't invent a new option name so I made commands either a list or an attrset.
I prefer attrsets with attrNames as command group names.
I think it should be the first-class feature and should be documented and type checked.
So, I see these approaches:
- Allow
commandsonly as anattrset - Create a new option for commands as an attrset, leave commands as a
list- What should be the name?
- Allow
commandsto be either alistor anattrset, do something about merging lists and attrsets for flake-parts users.- What in particular can make it hard to merge?
- I need a concrete example of a devshell setup with flake-parts
- I find it nice to have a simpler representation that can be used to explain the nested options.
- Provide just a function that converts a
commandsattrset to a list- I don't like this idea because then
commandsattrset won't be the first-class feature and can't naturally go into docs.
- I don't like this idea because then
Uh oh!
There was an error while loading. Please reload this page.