nixops icon indicating copy to clipboard operation
nixops copied to clipboard

Create multiple networks from the same flake

Open f4814 opened this issue 4 years ago • 2 comments

When creating a network from a flake, the network definition from outputs.nixopsConfigurations.default is used. However I think that using something like nixops create -d test --flake .#test, which would use the definition from output.nixopsConfigurations.test should be possible. Otherwise making a nixopsConfigurations attrset doesn't really make sense and is pretty counter-intuitive. (I had to check the code to find out here to find out, what the weird error I was getting meant).

f4814 avatar Apr 10 '21 17:04 f4814

I think maybe we should default -d to the attribute name as well, although storing multiple deployments in the same remote state is a bad idea because of locking.

roberth avatar Aug 26 '21 12:08 roberth

I think I may be in a similar position: I've migrated from nixops 1.x where I had multiple deployments with different network definitions and I'm unable to replicate this in nixops 2.0. My current "solution" is to move my networks to separate folders and use nixops list --network=ec2 or nixops list --network=kvm etc...

It doesn't seem to be possible to make multiple network definitions in either nixops.nix or flakes.nix, unless I'm missing something.... which is quite possible!

(My use case is staging and testing environments using libvirtd locally and a proper deployment on ec2.)

JamesReynolds avatar Jan 28 '22 16:01 JamesReynolds