Is there a smart way to modularize inputs per aspect? #336
|
I've made a janky hack but it doesn't feel right. The idea is defining custom provided flakeModules that can be included for aspects, which'll influence the global flake-file.inputs for write-flake. The problem is when using a den config across hosts, I don't want every host to download all the flake-file.inputs despite only needing a handful.. that's not very modular. |
Replies: 2 comments 6 replies
|
Hey @baltimore-balls, that is a nice idea, I've also been thinking about it, but have not wrote anything for it. How are you doing this ? I'd like to see some code you have. |
|
btw, here's how I was thinking about it:
inputs = den.lib.aspects.resolve "inputs" [] some-aspect;this would return a module having all the inputs classes from some-aspect and its dependencies, then we would need to provide that to flake-file, maybe we need a custom @baltimore-balls, I like the idea of this feature, thanks for sharing it. perhaps add to #329 |
btw, here's how I was thinking about it:
flake-file.inputsoptions are project level, so if we'd like to have something like "only give me the inputs needed if I want my-laptop.nixos", we would likely need a custom classinputs, so we can dothis would return a module having all the inputs classes from some-aspect and its dependencies, then we would need to provide that to flake-file, maybe we need a custom
nix run .#write-aspect-inputs den.aspects.some-aspectapp, but that would overwrite the project flake.nix, so we need to consider specifying an output to that app.@baltimore-balls, I like the idea of this feature, thanks for sh…