-
|
I'm currently writing a config using flake-parts and following the dendritic pattern. I'm now trying to create a wrapped niri package in a similar manner to this, but with the configuration split across multiple files, and im still struggling with importing the individual modules. Basically, I want to achieve something along the lines of this: perSystem = { pkgs, lib, ... }: {
packages.niri = inputs.wrapper-modules.wrappers.niri.wrap {
inherit pkgs;
imports = [
self.<moduleType>.niri-autostart
self.<moduleType>.niri-binds
# and so on
];
};
};I'm not quite sure what to put in place of flake.wrappers.niri = { pkgs, wlib, ... }: {
imports = [ wlib.wrapperModules.niri ];
# configuration options here
};But at that point I'm still unsure about how to split the configuration into multiple files. I tried checking some public configs, but unfortunately that didn't really get me anywhere, and my other attempts so far resulted in infinite recursion. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Hmm Yeah On the bright side, if the module was imported via a path, as So, method 1, would be put But that would of course be somewhat cumbersome, as you might then want to use So, the way I would recommend is to use the and then you would We don't set a "class" for our wrapper module evaluation, because not all wrapper modules are importable in all other wrapper modules, so, we would want a class per program technically. It won't enforce this (unless you pass class to your call of |
Beta Was this translation helpful? Give feedback.
Hmm
Yeah
flake.wrappersand the exportedflake.wrapperModulesreally do usually expect a whole wrapper module with the program and stuffOn the bright side, if the module was imported via a path, as
wlib.wrapperModules.niriis in your example, it will automatically deduplicate.So, method 1, would be put
wlib.wrapperModules.niriinflake.wrappers.niri-bindsand the like, and then you would also export one final niri wrapper with all of those imported viaself.wrapperModules.niri-bindsand such, (which get automatically created based onflake.wrappers).But that would of course be somewhat cumbersome, as you might then want to use
perSystem.wrappers.packages.niri-binds = true;to disable t…