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 flake part #1872

Open
MangoIV opened this issue Mar 5, 2023 · 6 comments
Open

Add a flake part #1872

MangoIV opened this issue Mar 5, 2023 · 6 comments
Labels
enhancement New feature or request preserved Keep stale bot away

Comments

@MangoIV
Copy link
Contributor

MangoIV commented Mar 5, 2023

Description of the proposal

flake-parts are a new, really nice framework for defining nix flakes. They allow for easy composability, nice error messages, usage of types and easy, automated documentation.

Especially the latter three is what haskell.nix lacks a bit, imho. I think exporting a flake part would simplify documentation and make configuration of a Haskell project with haskell.nix very easy.

In my opinion flake-parts are the first framework that really feels somewhat "polished" and not adhoc. haskell.nix itself uses the module system, however, I think a more complete documentation, reuse of the tools provided by flake-parts (this would also reduce maintenance overhead) could really increase adoption.

Describe the solution you'd like

I would like haskell.nix to export a flakeModule similarly to how e.g. cachix/pre-commit-hooks.nix or hercules-ci/hercules-ci-effects does it and to ultimately integrated within the documentation in https://flake.parts

Describe alternatives you've considered / Additional context

Providing wrappers is the biggest alternatives but it mainly causes duplicated work for consuming parties, it would be nice to just have the support for this upstreamed here.

Note
I would like to volunteer in an effort if this was going to be happening.

@MangoIV MangoIV added the enhancement New feature or request label Mar 5, 2023
@angerman
Copy link
Collaborator

angerman commented Mar 6, 2023

@MangoIV I'm fundamentally not against this. It's a bit hard for me to judge what the impact would be. Can you help elaborate on that?

Would existing consumers still be able to use haskell.nix as it is today?

@MangoIV
Copy link
Contributor Author

MangoIV commented Mar 6, 2023

For the consumer there is two main impacts:

  • easier to use API
  • more, automatic documentation
    The latter would probably also apply to the user that doesn't use the flake-parts api

For haskell.nix, if both APIs are maintained this of course causes maintenance overhead and it would probably be good to remap the old API onto the new one such that documentation from the modules can be reused. I'm not aware of how hard this will be but I imagine it to be quite a chunk of work.

@MangoIV
Copy link
Contributor Author

MangoIV commented Mar 6, 2023

I guess we can reuse a lot because we're already passing modules to cabalProject' and stackProject'

@angerman
Copy link
Collaborator

Sounds like a good idea to me.

@yvan-sraka yvan-sraka self-assigned this May 31, 2023
@stale
Copy link

stale bot commented Sep 28, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Sep 28, 2023
@stale stale bot closed this as completed Nov 27, 2023
@hamishmack hamishmack added preserved Keep stale bot away and removed wontfix labels Nov 28, 2023
@hamishmack hamishmack reopened this Nov 28, 2023
@andreabedini
Copy link
Member

FWIW I have been using haskell.nix with flake.parts and I am slowly getting an idea of how they could work toghether.

@yvan-sraka yvan-sraka removed their assignment Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request preserved Keep stale bot away
Projects
None yet
Development

No branches or pull requests

5 participants