Open f4814 opened 3 years ago
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.
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.)
When creating a network from a flake, the network definition from
outputs.nixopsConfigurations.default
is used. However I think that using something likenixops create -d test --flake .#test
, which would use the definition fromoutput.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).