diff --git a/nix/nixos-module/server/lxc-containers.nix b/nix/nixos-module/server/lxc-containers.nix index 311f0bb..b62b716 100644 --- a/nix/nixos-module/server/lxc-containers.nix +++ b/nix/nixos-module/server/lxc-containers.nix @@ -122,8 +122,12 @@ let mkdir -p /var/lib/lxc/$c/rootfs/$d done ln -fs $SYSTEM/init /var/lib/lxc/$c/rootfs/init + done - set +e + # Activate all the desired container after all of them are + # built + set +e + for c in $@; do active=$(systemctl is-active lxc@$c) if [[ "$active" = active ]] ; then echo Activating $c @@ -135,8 +139,8 @@ let echo Starting $c systemctl start lxc@$c fi - set -e done + set -e ''; enable-script = pkgs.writeScriptBin "enable-containers" ''