Replies: 2 comments
-
|
In english Define a helper module defining an option The trick is figuring out what Then, people who want to add theme options, can import that and do something with those Importing these options, once the helper module for that exists, and defining their implementations for your wrapper module is optional but encouraged, as obviously some programs will make this harder than others. |
Beta Was this translation helpful? Give feedback.
-
|
This, and I also want a helper module for docgen, and a helper module for creating service files A docgen helper module is my next personal project. Followed by service files. The services options, Im thinking its just to be a helper module that re-enables configurePhase and makes the service definition files in it. There are options in nixos and home manager which can receive a derivation with service files at particular locations and then enable the service. People wrapping programs with services could then import that module and use the options, and then pass the drv to the right option in nixos or home manager to install that service. Maybe we can add some more prepared versions of mkInstallModule for nixos, home-manager, etc, that install both the programs and their services. It needs to be able to handle multiple services, for home, system, and maybe be able to be reimplemented or have some compat with some other things like this nimi thing or services-flake |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
From a reddit discussion, felt it deserved to be here
Question from commenter:
What are your thoughts about something like this?
I'm thinking about how to bridge the gap between things like stylix or nix-colors and wrapper modules.
Should this be handeled by a separate system or could this become part of your lib?
Answer/thoughts:
Programs that can implement this should definitely do so. We can implement a helper module that defines the options for them so you dont have to redefine the color options in every module, and if people want to include a theme option in their wrapper, they can import the options for them and use the config.newoptions to write their wrapper.
A decent amount of that might even be able to be implemented as a type we can put in lib along with the helper module which would be under /modules under its first letter like the rest
That way, it can handle any program, but everyone mostly shares an interface for it. an "options only" helper module, basically. An interface in module form.
Doing it that way would both reduce boilerplate, and also increase awareness of conventions
The modules system gets a lot more interesting when it isnt global haha
"import options" is not a global thing anymore. Its for that program. So we can have a top level theme set of options that every program can import the same module for if they want to define it without conflicts. I would like to namespace it to
.themethough probablyBeta Was this translation helpful? Give feedback.
All reactions