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 replace xyzBuilder with unified 'outputsBuilder' #59

Merged
merged 4 commits into from
May 19, 2021

Conversation

gytis-ivaskevicius
Copy link
Owner

No description provided.

Comment on lines -197 to +213
(optionalAttrs (args ? ${builder})
{ ${output} = args.${builder} pkgs; });
(optionalAttrs (systemOutputs ? ${output})
{ ${output} = systemOutputs.${output}; });

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this would be better done with a mapAttrs. That way its future proofed if more system-spaced outputs ever get added.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also code is a bit simpler, mkOutput is no longer necessary

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I agree mapAttrs would be better option but we are dealing with multiple restrictions:

  • nix flake show should not error - we cant output empty attrsets
  • outputs must be merged - if we just go with mapAttrs while keeping in mind the first point - not all attrs will get merged.

And yeah, I guess I could go over the names and just generate attrset out of that. Probably will change that but I really should go and get some sleep now :D

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good, I think it could probably be used in the future once we remove the deprecated arguments. For now this works well.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not going to do the attrs from list thingy. At least for time being - could not find a solution that I'd be happy with. Its other solutions are more complex and use around the same amount of lines

@gytis-ivaskevicius
Copy link
Owner Author

gytis-ivaskevicius commented May 17, 2021

Also, not sure what happened to GitHub actions - but it does not show output for some reason 🤔 Anyways, there are two checks - one uses xyzBuilder, other outputsBuilder - they both result in exactly the same nix flake show

What needs to be tackled before merge:

  • Apply @Pacman99 suggestion
  • Fix tests/examples to use outputsBuilder

If you guys wish to work on it - feel free to just push changes to this branch. But I'm pretty sure that ill find some time tomorrow to fix this up

On a totally unrelated note - @blaggacao thank you for talking me into adding devshell <3 It is so dam convenient

@gytis-ivaskevicius gytis-ivaskevicius merged commit c7ba2eb into staging May 19, 2021
@gytis-ivaskevicius gytis-ivaskevicius deleted the add-outputs-builder branch May 19, 2021 21:11
@blaggacao
Copy link
Collaborator

Nice!

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.

3 participants