-
-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add the ability to supply a config instead of just a nixosConfigurations flake #92
Comments
I looking trough the source a little I think that adding a microvm.nix/nixos-modules/host.nix Line 22 in d578ed4
and applying it at(below) microvm.nix/nixos-modules/host.nix Line 122 in d578ed4
As this should enable the user to not be restricted to the prefix of By using the ? operator it would also be possible to maintain backwards compatibility, as one could just unless Though as of the way the microvm-command tool [below] is build ... it sadly would break as it expects the path the flakes contents to follow that name pattern I suggested changing above. So that tool would also need to be modified As for now these seem to be the only things that would need to be changed to adapt to the behavior I desire. |
@bolives-hax I just had the same problem and implemented this quickly. If you are open to trying the liked PR, I'd appreciate your feedback and whether it works as you expect it to. |
In my opinion this is not 100% done yet. It would be really nice to pass a |
Hey as of the way my nixos configurations are structured. It is not possible for me to supply the system configuration for the vm over the route below.
as of the following line of code it seems
microvm.nix/nixos-modules/host.nix
Line 122 in d578ed4
Why could this matter?. Let me suggest a use case:
Lets say I want to supply certain information to my "vm_httpd" vm definition. Such as a domain names it makes use of when generating http. Instead of declaring that in
/etc/nixos#nixosConfigurations.vm_httpd
it would seem much more cool to generate it from within my primary config/etc/nixos#nixosConfigurations.bigServer
via a convenience function calledor something like that. This starts being useful as soon as one wishes to spawn multiple vm with nearly identical configuration values. Below can be seen how id roughly imagine that and how I already do it for my containers at least:
Being able to express large parts of my nixos configurations as functions that then end up producing valid configurations to actually be build would allow for much more dynamic configuration approaches. Less duplication and cleaner code.
I personally don't seem to see any issues with implementing this alternative behavior, though maybe im missing something or it goes against the design decisions taken by the author so I'd rather be interested in the current take on my suggestion. If there is any interest in this feature and the option of a potential change being merged exist I would also make the change myself.
The text was updated successfully, but these errors were encountered: