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

Extract custom system builds from devosSystem out of lib #170

Closed
Pacman99 opened this issue Mar 15, 2021 · 9 comments
Closed

Extract custom system builds from devosSystem out of lib #170

Pacman99 opened this issue Mar 15, 2021 · 9 comments
Labels
APIv1 related to 1.0 api stabilization enhancement New feature or request

Comments

@Pacman99
Copy link
Member

Pacman99 commented Mar 15, 2021

Describe the solution you'd like

There should be some way for users to add and edit their own custom system builds for all hosts like what is currently being done for isoConfig and in the future hmConfig.

Describe alternatives you've considered

Edit lib/devos/devosSystem.nix. But optimally the end user shouldn't have to edit a lib function.

Additional context

I think this could be done as a file that defines an attrset mapping builds to nixosSystem's(or darwinSystems, homeConfigurations, robotnixConfigurations). And all builds will be available under config.system.builds as is currently being done.

related: #168


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@Pacman99 Pacman99 added the enhancement New feature or request label Mar 15, 2021
@nrdxp
Copy link
Collaborator

nrdxp commented Mar 15, 2021

The reason lib.devos.<functions> aren't exported into the global lib, is that they should continue to be reduced until ideally non-existent, or close. This is why I'm trying to focus mainly on #152, and at least get a solid PR out with a good start.

@Pacman99
Copy link
Member Author

To be clear I'm not saying change the location of devosSystem. I just want to extract out the isoConfig within it to a file that users can easily find and edit and document that. So a user can change the isoConfig or add their own custom system builds.

@blaggacao
Copy link
Contributor

I think this can be tackled now, I don't plan to play with isoConfig for the next couple of days.

@Pacman99
Copy link
Member Author

I'm not yet sure how to go about doing this. I think an important question to answer is, should there be a user facing api for adding custom builds? If we decide against that, this would just involve adding a few more files to lib to extract the code.

@blaggacao
Copy link
Contributor

I think we should start by splitting, then maybe we could get a clearer picture if we need a user facing API. I also think if #91 is implemented, at least a user facing api within that same file hierarchy would be quite ok, since then a rebase would become cheap, also for nix flake template users, even if code is somewhat mixed together.

@blaggacao blaggacao added the APIv1 related to 1.0 api stabilization label Apr 11, 2021
@blaggacao
Copy link
Contributor

We might include exposure to the .builder fup arg in api-next to satisfy this use case and be able to close this issue.

@Pacman99
Copy link
Member Author

If you do set the .builder arg then you would overwrite the the iso and homes builds since you would overwrite devosSystem. Either way I'm going to close this since those modules have been moved to lib.modules, and adding new custom builds is very straightforward - add a couple llines to devosSystem and add a module to lib.modules. And after some thinking, I just can't see a way for this to be done outside of devosSystem, so I don't actually think its possible to do any more extraction.

@Pacman99
Copy link
Member Author

Reopening, I realized that the list of modules is available in nixos as a module arg, so we might be able to write isoConfig as a module. And mkHomeConfigurations might be able to do all the work of setting up standalone home-manager configurations.

So it might actually be possible to obsolete devosSystem entirely.

@Pacman99
Copy link
Member Author

Pacman99 commented May 3, 2021

implemented in #266

@Pacman99 Pacman99 closed this as completed May 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
APIv1 related to 1.0 api stabilization enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants