summaryrefslogtreecommitdiffstats
path: root/lass/3modules/sync-containers.nix
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2021-01-23 17:36:12 +0100
committerlassulus <lassulus@lassul.us>2021-01-23 17:36:12 +0100
commit7a654da5dec445482ef40c4b9642f92e19693f2c (patch)
treeb1b60b3301dd79c2a3400a8a1f20e5ed2eaa08c1 /lass/3modules/sync-containers.nix
parent1fb7abde922545b3b1ea3887bd5a3f2a57bbb0be (diff)
l sync-containers: shutdown container if already up
Diffstat (limited to 'lass/3modules/sync-containers.nix')
-rw-r--r--lass/3modules/sync-containers.nix2
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}" ''