diff options
author | lassulus <lassulus@lassul.us> | 2021-01-23 17:36:12 +0100 |
---|---|---|
committer | lassulus <lassulus@lassul.us> | 2021-01-23 17:36:12 +0100 |
commit | 7a654da5dec445482ef40c4b9642f92e19693f2c (patch) | |
tree | b1b60b3301dd79c2a3400a8a1f20e5ed2eaa08c1 /lass/3modules | |
parent | 1fb7abde922545b3b1ea3887bd5a3f2a57bbb0be (diff) |
l sync-containers: shutdown container if already up
Diffstat (limited to 'lass/3modules')
-rw-r--r-- | lass/3modules/sync-containers.nix | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lass/3modules/sync-containers.nix b/lass/3modules/sync-containers.nix index 25ba2589b..ebf440c4e 100644 --- a/lass/3modules/sync-containers.nix +++ b/lass/3modules/sync-containers.nix @@ -155,6 +155,8 @@ in { if [ -h /var/lib/containers/${ctr.name}/var/src/nixos-config ] && (! ping -c1 -q -w5 ${ctr.name}.r); then ${pkgs.nixos-container}/bin/nixos-container run ${ctr.name} -- nixos-rebuild -I /var/src switch + else + ${(stop ctr.name).${ctr.format}} fi '') (pkgs.writeDashBin "stop-${ctr.name}" '' |