From d2deabc6b2a4889607abe1cb380dabb01311d151 Mon Sep 17 00:00:00 2001 From: Jack O'Sullivan Date: Sat, 11 Jun 2022 17:04:38 +0100 Subject: [PATCH] nixos/deploy-rs: Start container if not running on deploy --- nixos/modules/deploy-rs.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nixos/modules/deploy-rs.nix b/nixos/modules/deploy-rs.nix index dcc663e..56201f2 100644 --- a/nixos/modules/deploy-rs.nix +++ b/nixos/modules/deploy-rs.nix @@ -58,7 +58,8 @@ let path = pkgs.deploy-rs.lib.activate.custom ctrConfig.my.buildAs.container '' source ${systemdUtil}/bin/systemd-util.sh ${if c.hotReload then '' - if systemctl show -p StatusText systemd-nspawn@${n} | grep -q "Dummy container"; then + if (! systemctl show -p ActiveState systemd-nspawn@${n} | grep -q "ActiveState=active") || \ + systemctl show -p StatusText systemd-nspawn@${n} | grep -q "Dummy container"; then action=restart else action=reload