From 01cb95de6de2dc2259c0ef69999328d4421ad9bb Mon Sep 17 00:00:00 2001 From: Jack O'Sullivan Date: Wed, 20 Dec 2023 18:29:08 +0000 Subject: [PATCH] nixos/containers: Fix initial dummy deploy --- nixos/modules/containers.nix | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/nixos/modules/containers.nix b/nixos/modules/containers.nix index 23ca463..0d2af04 100644 --- a/nixos/modules/containers.nix +++ b/nixos/modules/containers.nix @@ -209,12 +209,16 @@ in mkdir -p -m 0755 "$root"/sbin "$root"/etc touch "$root"/etc/os-release - if [ -e "${containerSystem}"/prepare-root ]; then - initSource="${containerSystem}"/prepare-root - else - initSource="${containerSystem}"/init - fi - ln -sf "$initSource" "$root"/sbin/init + ${if system == sysProfile then '' + if [ -e "${sysProfile}"/prepare-root ]; then + initSource="${containerSystem}"/prepare-root + else + initSource="${containerSystem}"/init + fi + ln -sf "$initSource" "$root"/sbin/init + '' else '' + ln -sf "${containerSystem}/prepare-root" "$root"/sbin/init + ''} ''; postStop = ''