4 ms·
On borderline, thinking to learn nix. Few questions: Can I define VM images with nix? Can those VM images be loaded into VirtualBox? Also, possible to do simil
by wg0 2y ago
On borderline, thinking to learn nix. Few questions:
Can I define VM images with nix? Can those VM images be loaded into VirtualBox?
Also, possible to do similar to build AMIs or other cloud VMs such as Hetzner where my "Dockerfile" is a nix file which defines the system to be built and then it has everything in place once built including tools, libraries, configuration and such?
Thoughts?
EDIT: Typos
- tkz1312 2y agoyes to all. https://github.com/nix-community/nixos-generators https://github.com/nix-community/nixos-generators
- gallexme 2y agoAnd for cloud/dedicated servers perhaps https://github.com/nix-community/nixos-anywhere https://github.com/nix-community/nixos-anywhere (There's also a terraform module ) And for state changes https://github.com/serokell/deploy-rs https://github.com/serokell/deploy-rs Or Colmena /nixops/ and x other For secret handling perhaps https://github.com/ryantm/agenix/ https://github.com/ryantm/agenix/ + https://github.com/oddlama/agenix-rekey https://github.com/oddlama/agenix-rekey The ecosystem is in my experience very well fleshed out (7 yrs of use), as long as you don't require a knowledgebase/wiki/ up2date documentation, it's not been a issue for me since I could always fall back on Linux knowledge and just looking for how other distributions do x / how the thing itself is configured , and looking at how perhaps a existing nix module wraps that
- wg0 2y agoOh I am converted! Will try to setup system using nix instead of packer.
- arianvanp 2y agoYep for sure! We even have a neat upload-ami cli tool: https://github.com/NixOS/amis https://github.com/NixOS/amis
- wg0 2y agoThat's awesome! I think all the missing pieces are in place. :)
- JamesSwift 2y agoYes but with an asterisk. Nixos generators linked elsewhere is a really great tool to take a given nix configuration and build it for consumption in many contexts (eg i use the same one to both build initial proxmox vm images and then also update those running images). The problem is that you will need a hardware-configuration.nix that caters to the end environment. Ive worked around this by pre-generating it and then copying it into the result but I wish there was a better, less manual, process.