3 ms·
I am curious how or where NixOS fits in a a cloud or IaaS environment. I feel like AMIs and containers address the reproducible builds problem and blue/green d
by bogomipz 9y ago
I am curious how or where NixOS fits in a a cloud or IaaS environment.
I feel like AMIs and containers address the reproducible builds problem and blue/green deploys the rollback issue. Could NIXOS still be complimentary in an AWS/AMI environment?
- hollerith 9y agoYou can have thousands of packages in a single Nixos installation and if 200 of those packages directly or indirectly depend on some library L, you usually only need one copy of L to fulfill those 200 dependencies. In contrast, if you put each package in its own container or VM, then you end up with 200 copies of L. So, the different technologies have different strengths and weaknesses. One weakness of Nix is that it is harder for most people to learn or to understand than containers or VMs are. Some people use Nix or Nixos as part of their process for building containers or VM images. (I wonder whether there is any build system that uses containers instead of file names containing cryptographic hashes (like Nix does) or chroots (like Arch Build system does) to "enforce package isolation" during building.)
- bogomipz 9y agoThanks for the replies and the links. Makes sense. Cheers.
- Nullabillity 9y agoYes. NixOS can be set up to output a ready-to-run AMI with your customizations, as well as any other kind of image. For example, there are official binaries at https://nixos.org/nixos/download.html https://nixos.org/nixos/download.html, which I believe are built by https://github.com/NixOS/nixpkgs/blob/master/nixos/maintainers/scripts/ec2/create-amis.sh https://github.com/NixOS/nixpkgs/blob/master/nixos/maintaine.... You can then either replace the images as needed, or redeploy in place. NixOps can also automatically create and destroy EC2 VMs, EBS disks, and so on for you, based on your NixOS config. NixOps also makes it very easy to set up a local copy of your network using Virtualbox. Personally I use a common baseline image that is preseeded with my SSH key, and then deploy whatever setup I need using NixOps. You can read more about that approach at https://nixos.wiki/wiki/Virtualization_in_NixOS https://nixos.wiki/wiki/Virtualization_in_NixOS.