When developing NixOS tests, it is usually slow and tedious to re-run the test every time one makes a change. For this reason, I usually use driverInteractive, which allows me to muck around on the machines and see what happens in real time, re-run parts of tests that have failed, etc.
However, it often happens that I want to modify the NixOS configuration for one or more machines and redeploy. In this case I am back to re-running the driver every time I make a change.
I would like a way to modify the configuration and re-deploy, as I would with nixos-rebuild switch normally.
proposed solution
I developed a solution that I've been using privately #281331. It adds a command to the output of driverInteractive that can be used to push that configuration to the actively running test.
alternate solutions
we can just continue re-running the driver and restarting the machines every time we make a change to the configuration.
this is slow and annoying
getting the configuration somehow into /etc/nixos/configuration.nix. This way people could modify the configuration on the machine and run nixos-rebuild switch.
you have to generate a configuration.nix, and it's not clear which options to include and which not. It will end up in a different form than people are editing it in their test.
the changes are ephemeral until you also make them on the test itself. which is easy to forget to do.
iterating on your tests in a separate environment (e.g. nixos-shell)
requires copying changes over to the test, which is error-prone
requires you to be familiar with two frameworks for spinning up nixos vms
other systems for spinning up vms (such as nixos-rebuild) are often less convenient for spinning up several vms that all have access to each other
the two systems for spinning up vms might have differences that affect the running of the tests.
Issue description
When developing NixOS tests, it is usually slow and tedious to re-run the test every time one makes a change. For this reason, I usually use
driverInteractive
, which allows me to muck around on the machines and see what happens in real time, re-run parts of tests that have failed, etc.However, it often happens that I want to modify the NixOS configuration for one or more machines and redeploy. In this case I am back to re-running the driver every time I make a change.
I would like a way to modify the configuration and re-deploy, as I would with
nixos-rebuild switch
normally.proposed solution
I developed a solution that I've been using privately #281331. It adds a command to the output of
driverInteractive
that can be used to push that configuration to the actively running test.alternate solutions
we can just continue re-running the driver and restarting the machines every time we make a change to the configuration.
getting the configuration somehow into
/etc/nixos/configuration.nix
. This way people could modify the configuration on the machine and runnixos-rebuild switch
.configuration.nix
, and it's not clear which options to include and which not. It will end up in a different form than people are editing it in their test.iterating on your tests in a separate environment (e.g.
nixos-shell
)