move necessary parts of core to mkHosts#223
Conversation
|
What is the semantic for disabling core? From my brief review of the code, it still seems to be included. |
|
Yup its still included by default. But now you could do: devos.core.enable = false;in a host file to drop core. In the future we could add more options, so you could, for example, just add the nix stuff and not the aliases. But for now I wanted to keep this simple. |
|
I'm not so sure about this, as it might blur the lines between profiles and modules. So having modules enabled by default might be a dangerous precedent. I see it is perfectly valid nix, but people should define things they always want in a If they do, profiles are a purely constructive index of your environment. If people start enabling modules by default, nobody can tell the state of the world by only looking at profiles alone. This is a recipe to complexity. We actually might error out on modules that are enabled by default to enforce sane contracts about modules. I'm not sure if it is currently documented, but as much as we "forbid" to define options in profiles, we probably shouls "forbid" altering the system state in modules. |
|
modules definitely should alter system state, but I think your point is they shouldn't by default. And thats where I disagree. Even nixos has many modules enabled by default to ensure you get a proper linux system running. And in the same way, this core module could be enabled by default to get a proper devos system - you can't use devos without unstable features. There are other parts of this module that probably shouldn't be enabled by default like aliases and fonts. And those should probably go under more options. An alternative is to enable by default in Also I messed this up and forgot to add |
|
This is an excellent discussion to have an one that needs to happen. FWIW, I have been "feeling" like there should be a way to disable if I were going to do it, this is the cleanest implementation for sure. I think it's okay to move forward on this as long as we ensure nothing absolutely critical for NixOS to function properly with flakes is left in |
|
Yeah I agree with that. Since this PR isn't blocking anything else, we can take some time to figure out what can be moved and actually add a few more options. Also possibly rename it to something else, if its no longer critical, I'm not sure core is the right name anymore. Maybe something along the line of defaults - from flake-utils-plus - or features. |
|
By modularizing it, we extend the devos api to modules, and that's a bit unwarranted. We should be able to include the devos dependencies into mkHosts and keep an henceforth optional |
I've actually been wanting to extend devos api to modules. I think its one of the most powerful features of nixpkgs, and instead of writing our own api and methods to get information from users, the module system has a a great and perfected method of passing and storing data. The PR for multi-arch support already established this somewhat, by getting information from the user through the use of
So I think we are in agreement in the first part that the necessary bits of core should go to |
|
Moved all the nix related config to |
allows core to be disabled and prevents auto-import as a profile
move all nix related config to mkHosts create new options for devos defaults and enable by default in hosts
|
I'm thinking of making this PR just a move of all required core features to |
mkHosts
|
Made a new PR for what I actually now want to accomplish, #229, so closing this. |
Title doesn't match the patch yet.
I want to move all the necessary nix features of core to
mkHosts, and go back to importing core through suites so we don't subvert the standard devos api. Then to remove core, you can just drop the line in suites/delete the core profile.