parent
dfff241257
commit
aa1b19d964
13
packages.nix
13
packages.nix
|
@ -97,6 +97,7 @@ lib.attrsets.mapAttrs
|
|||
rebuildArg = "--flake ${self}#${name} ${overrideInputsArgs} --accept-flake-config";
|
||||
hostConfig = self.nixosConfigurations."${name}".config;
|
||||
declaredRunnerDrvPath = discardStringCtx hostConfig.microvm.declaredRunner.drvPath;
|
||||
declaredRunnerOutPath = discardStringCtx hostConfig.microvm.declaredRunner.outPath;
|
||||
toplevelDrvPath = discardStringCtx hostConfig.system.build.toplevel.drvPath;
|
||||
toplevelOutPath = discardStringCtx hostConfig.system.build.toplevel.outPath;
|
||||
# let /var/lib/microvm/*/flake point to the flake-update branch so that
|
||||
|
@ -254,21 +255,15 @@ lib.attrsets.mapAttrs
|
|||
exit 2
|
||||
''}
|
||||
|
||||
${hostConfig.system.build.copyToServer} ${declaredRunnerDrvPath}
|
||||
nix build -L --no-link ${declaredRunnerDrvPath}^*
|
||||
${hostConfig.system.build.copyToServer} ${declaredRunnerOutPath}
|
||||
|
||||
${hostConfig.system.build.runOnServer} bash -e <<END
|
||||
set -eou pipefail
|
||||
hostname=\$(cat /etc/hostname)
|
||||
if [[ "\$hostname" != ${name} ]]; then
|
||||
echo "hostname of ${target} was expected to be ${name} but is \$hostname. Aborting to be safe..."
|
||||
exit 2
|
||||
fi
|
||||
|
||||
${createDirsCopyCurrent name}
|
||||
|
||||
ln -sfT ${hostConfig.microvm.declaredRunner} current
|
||||
ln -sfT ${declaredRunnerOutPath} current
|
||||
echo '${selfRef}' > flake
|
||||
|
||||
${createSymlinks name}
|
||||
|
||||
systemctl restart microvm@${name}.service
|
||||
|
|
Loading…
Reference in New Issue