The goal of this issue is just checking the feasibility. For the project purposes it would be nice running nixos-anywhere in a NixOS test, to do this I believe there are at least two possibilities:
a NixOS test with 2 hosts in the same virtual network, one host runs nixos-anywhere and deploys a remote NixOS configuration to the other host. The drawbacks are:
we are deploying NixOS on a (virtual) machine that already runs NixOS, we are not really exploiting (so testing) nixos-anywhere
I believe that nixos-anywhere reboots the target host and I've no idea how NixOS tests behave when you reboot an host.
a NixOS test with just one host that runs a VM with QEMU, this allows us to run other operating systems (e.g. we can simply fetch already baked qcow2 ubuntu images). The drawbacks are:
we need nested KVM
We need KVM for both solutions (possibly also nested KVM). For this issue we can simply to not run these tests in CI but before delivering the milestone 3 we need to update the Hercules CI agent and enable KVM on CI.
The goal of this issue is just checking the feasibility. For the project purposes it would be nice running
nixos-anywhere
in a NixOS test, to do this I believe there are at least two possibilities:nixos-anywhere
and deploys a remote NixOS configuration to the other host. The drawbacks are:nixos-anywhere
nixos-anywhere
reboots the target host and I've no idea how NixOS tests behave when you reboot an host.qcow2
ubuntu images). The drawbacks are:We need KVM for both solutions (possibly also nested KVM). For this issue we can simply to not run these tests in CI but before delivering the milestone 3 we need to update the Hercules CI agent and enable KVM on CI.
PS: apparently
nixos-anywhere
itself implements a test that dynamically creates a new host (still NixOS if I understand it correctly). I believe it could be a good starting point: https://github.com/nix-community/nixos-anywhere/blob/main/tests/from-nixos.nix