[HN Gopher] NixOS-generators - Collection of VM and Container di...
       ___________________________________________________________________
        
       NixOS-generators - Collection of VM and Container disk image
       builders for NixOS
        
       Author : peter_d_sherman
       Score  : 40 points
       Date   : 2024-03-26 15:24 UTC (7 hours ago)
        
 (HTM) web link (github.com)
 (TXT) w3m dump (github.com)
        
       | peter_d_sherman wrote:
       | Related:
       | 
       | Building NixOS qcow2 images with flakes:
       | 
       | https://tarnbarford.net/journal/building-nixos-qcow2-images-...
       | 
       | Build a bare bones bootable nixos qcow2 image suitable for
       | running with libvirt/qemu/kvm:
       | 
       | https://gist.github.com/tarnacious/f9674436fff0efeb4bb6585c7...
       | 
       | A Journey into Nix and NixOS (Building a QEMU image):
       | 
       | https://williamvds.me/blog/journey-into-nix/#:~:text=Buildin...
       | 
       | Setting up qemu VM using nix flakes:
       | 
       | https://gist.github.com/FlakM/0535b8aa7efec56906c5ab5e32580a...
        
         | Jhsto wrote:
         | Another note, NixOS containers with systemd-nspawn
         | cpmpatibility: https://nixos.wiki/wiki/NixOS_Containers
         | 
         | There is a good blog post here about how these work:
         | https://www.tweag.io/blog/2020-07-31-nixos-flakes/
         | 
         | And of course, it is just a tarball, so it works on every
         | systemd based distro.
        
       | Cyph0n wrote:
       | This is one of the "magical" capabilities provided by Nix and
       | NixOS imo.
       | 
       | I recently used this NixOS module to build a new machine as a
       | Proxmox VMA all while sharing the common config with my existing
       | NixOS machine. I then imported the VM into Proxmox, expanded the
       | disk size, and it booted immediately! There were a few manual
       | things I had to do to get secrets working, but end-to-end, it
       | took me about 5 minutes.
       | 
       | You can do the exact same thing for other formats. For example,
       | you could have a bootable installer ISO that takes your base
       | config and adds specific tools on top that you'd want on a
       | portable USB.
        
       | spdustin wrote:
       | This caught my attention, and now I want to dive into NixOS more.
       | Can anyone suggest a solid set of starting resources for someone
       | with a (probably overly complex) home lab and experience with
       | macOS and Ubuntu/Debian?
        
         | Cyph0n wrote:
         | I would recommend this as a starting point for learning about
         | Nix and NixOS: https://zero-to-nix.com/
         | 
         | And this as a second reference:
         | https://nix.dev/tutorials/first-steps/index.html
        
       | colordrops wrote:
       | You can use this repo to build a raspberry pi SD card image. It
       | will build through an arm qemu instance, and works perfectly.
        
       | Ao7bei3s wrote:
       | I've recently been experimenting with nix generators. It's nice.
       | 
       | What's the most pleasant way to develop and build nix images if
       | your dev env is a regular Linux distro without nix installed?
       | 
       | So far the least bad seems to be running Nixos in a VM with VS
       | Code remote via SSH and scp'ing images around. At least quickemu
       | makes getting the VM pleasant. But VMs are cumbersome.
       | 
       | Docker would be great, but nix from the official Docker container
       | doesn't seem to like running as non-root, which means you can't
       | use volume mounts for the code and change the user ID so that the
       | file permissions are right from inside the container.
        
         | colordrops wrote:
         | Nix generators works on regular Linux distros with nix
         | installed.
        
       ___________________________________________________________________
       (page generated 2024-03-26 23:01 UTC)