Initialize nixos module system. (translators only) #249
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This initializes the structure for a potentially fully nixos modules based dream2nix framework.
For now only the translators and some related functionality is migrated as a test to allow for reviews.
In the future, further functionality could/should be migrated to
/src/modules
.Why we want this?:
Concerning the file structure:
The idea is that
/src/modules
is a flat structure of directories. It should be easy to find the source of an option definition by knowing the option attribute path.For example the option
functions.translators.{something}
can be found in/src/modules/functions.translators
Every file in
/src/modules/{category}
should contain aninterface.nix
and animplementation.nix
.This should make it easy to quickly find the interface definition as a contributor.
Transition phase:
With this, now the framework is a mix of nixos-modules and not nixos-modules. That is a bit ugly, but we have no better way other than slowly transitioning to the new structure, and letting both old and new structure access each other.
Currently the nixos modules pieces, can access the old non-module pieces by using the specialArgs
dlib
andcallPackageDream
.The non nixos-modules pieces can access the modules via the
framework
attribute which is brought in scope viacallPackageDream
.@yusdacra It would be great if you could review this since you had implemented the current custom module loading logic.
Now is the time to really optimize the new structure, before we decide to move more stuff over.
@infinisil In case you have time to have a quick look at this, it would be great. If not, don't worry.