Add initial nginx container

This commit is contained in:
2022-05-31 21:25:51 +01:00
parent e79fd4234c
commit 11dbc01ba0
11 changed files with 111 additions and 24 deletions

View File

@@ -27,9 +27,15 @@ let
name = "container-${n}";
value = {
path = pkgs.deploy-rs.lib.activate.custom ctrConfig.my.buildAs.container
''
systemctl ${if c.hotReload then "reload" else "restart"} systemd-nspawn@${n}
'';
(if c.hotReload then ''
if systemctl show -p StatusText systemd-nspawn@${n} | grep -q "Dummy container"; then
action=restart
else
action=reload
fi
systemctl "$action" systemd-nspawn@${n}
'' else "systemctl restart systemd-nspawn@${n}");
profilePath = "/nix/var/nix/profiles/per-container/${n}/system";
user = "root";