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
nixos/virtualbox: Adds more options to virtualbox-image.nix #42699
Conversation
Previously you could only set the size of the disk. This change adds the ability to change the amount of memory that the image gets, along with the name / derivation name / file name for the VM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see the point of these *Name options, why would they be useful?
''; | ||
}; | ||
vmDerivationName = mkOption { | ||
type = types.string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should all be types.str
instead
I'm trying to build some custom NixOS VMs for a workshop using this, and it's really handy to be able to change those names so that I can have Hydra produce an OVA with a particular appliance name and filename. Otherwise I have to create the OVA, then import it, change the name, and then export it again, which seems like a waste of time relative to just creating it with the name I want in the first place. |
Okay, that's |
I also wanted to be able to have a particular filename for the output OVA without having to monkey around with things in a second step, and at that point I also figured I should probably be naming these derivations differently in the nix store. If I didn't have a need / couldn't see a need to change the derivation name or filename, then I would have left them out :) If folks don't want that kind of flexibility in this module then that's fine - I can just maintain my own copy of this file. I just thought that if I wanted it that someone else might end up wanting it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm always a bit worried about cost vs. benefit of adding options. The cost is that a NixOS system takes longer to evaluate, and every single option contributes to that (I think it's about linear in the amount of options). The benefit is how many people actually end up using these options and finding them useful.
That said, I think these option are alright, I would be complaining more if it were over 1000 options.
Thanks for that feedback - it'll really help guide me in the future when I'm trying to decide between making a PR and maintaining something that maybe only a few people need in my local repos. It's great that moving between those is not a big drama in Nix :) |
Previously you could only set the size of the disk.
This change adds the ability to change the amount of memory
that the image gets, along with the name / derivation name /
file name for the VM.
Motivation for this change
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)