zlacker

[parent] [thread] 6 comments
1. rictic+(OP)[view] [source] 2026-02-04 16:27:27
Yep. What nix adds is a declarative and reproducible way to build customized OS images to boot into.
replies(2): >>Curiou+Ub >>schmuh+C82
2. Curiou+Ub[view] [source] 2026-02-04 17:20:16
>>rictic+(OP)
Nix is the best answer to "works on my machine," which is a problem I've seen at pretty much every place I've ever worked.
replies(1): >>0x457+bx
◧◩
3. 0x457+bx[view] [source] [discussion] 2026-02-04 18:47:14
>>Curiou+Ub
It's also an answer to caching with /nix/store. I wish more cloud services supported "give me your nixosConfiguration or something similar" instead of providing api to build containers/vms imperatively. Dockerfile and everything that mimics it is my least favorite way to do this.
replies(1): >>Cyph0n+e11
◧◩◪
4. Cyph0n+e11[view] [source] [discussion] 2026-02-04 21:06:41
>>0x457+bx
It’s fairly trivial to map your NixOS config into a VM image: https://nixos.org/manual/nixos/stable/#sec-image-nixos-rebui...

An alternative is to “infect” a VM running in whatever cloud and convert it into a NixOS VM in-place: https://github.com/nix-community/nixos-anywhere

In fact, it is a common practice to use the latter to install NixOS on new machines. You start off by booting into a live USB with SSH enabled, then use nixos-anywhere to install NixOS and partition disks via disko. Here is an example I used recently to provision a new gaming desktop:

    nix run github:nix-community/nixos-anywhere -- \
      --flake .#myhost \
      --target-host user@192.168.0.100 \
      --generate-hardware-config nixos-generate-config ./hosts/myhost/hardware-configuration.nix
At the end of this invocation, you end up with a NixOS machine running your config partitioned based on your disk config. My disko config in this case (ZFS pool with 1 disk vdev): https://gist.github.com/aksiksi/7fed39f17037e9ae82c043457ed2...
replies(1): >>0x457+DO1
◧◩◪◨
5. 0x457+DO1[view] [source] [discussion] 2026-02-05 02:19:35
>>Cyph0n+e11
I know that part is easy, i just nix-anywhere just yesterday to reinstall one of my servers. It's not what I'm talking about.
replies(1): >>Cyph0n+yY1
◧◩◪◨⬒
6. Cyph0n+yY1[view] [source] [discussion] 2026-02-05 03:48:51
>>0x457+DO1
Okay, so your idea is that cloud providers should make this even easier?

    $ nixos-rebuild build-image --flake .#myhost --image-variant amazon
    $ aws-cli image upload < result/images/image.ami
    $ aws-cli create vm --image={image}
7. schmuh+C82[view] [source] 2026-02-05 05:37:21
>>rictic+(OP)
Or try this: https://github.com/deepclause/agentvm, it's based on container2wasm, so the VM is fully defined by a Dockerfile.
[go to top]