How do I upgrade from nixos VMs to nix-ops

I have a bunch of virtual machines on some servers I share with friends which all run nixos 21.5.
Right now I have just manually edited the configuration.nix file on each machine.

Now I would like to use nix-ops to manage these machines instead.
Where do I start? Can I simply copy the config folders over to my laptop?

Probably the most straightforward way of starting nixopsing your setup is to create the following structure:

machines/
  | server1/configuration.nix
  | server2/configuration.nix
  | ...
deployment.nix

And have deployment.nix contain:

{
  server1 =
    { ... }:
    { imports = [ machines/server1/configuration.nix ];
    };

  server2 =
    { ... }:
    { imports = [ machines/server2/configuration.nix ];
    };

  # ...
}

And start refactoring and modularizing from there!

Uuh nice! That’s exactly what I was looking for. Thanks a lot :smiley: