packages: properly activate configuration to switch /etc files

This commit is contained in:
Sandro - 2023-11-13 01:58:58 +01:00
parent fc0699251b
commit b3835dccc4
Signed by: sandro
GPG Key ID: 3AF5A43A3EECC2E5
1 changed files with 8 additions and 1 deletions

View File

@ -216,7 +216,14 @@ lib.attrsets.mapAttrs
if [[ -n ''${NIXOS_REBUILD:-} ]]; then
echo "Switching to configuration..."
ssh ${target} -- ${toplevelOutPath}/bin/switch-to-configuration "''${@:-switch}"
ssh ${target} bash -e <<END
set -eou pipefail
${toplevelOutPath}/bin/switch-to-configuration "''${@:-switch}"
nix-env -p /nix/var/nix/profiles/system --set ${toplevelOutPath}
END
# ^ yes, this is required to be like this
fi
''
else throw "${name} is not configured to run on microvm.nix. Is it a physical host or is it deployed in Skyflake?"