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";
|
rebuildArg = "--flake ${self}#${name} ${overrideInputsArgs} --accept-flake-config";
|
||||||
hostConfig = self.nixosConfigurations."${name}".config;
|
hostConfig = self.nixosConfigurations."${name}".config;
|
||||||
declaredRunnerDrvPath = discardStringCtx hostConfig.microvm.declaredRunner.drvPath;
|
declaredRunnerDrvPath = discardStringCtx hostConfig.microvm.declaredRunner.drvPath;
|
||||||
|
declaredRunnerOutPath = discardStringCtx hostConfig.microvm.declaredRunner.outPath;
|
||||||
toplevelDrvPath = discardStringCtx hostConfig.system.build.toplevel.drvPath;
|
toplevelDrvPath = discardStringCtx hostConfig.system.build.toplevel.drvPath;
|
||||||
toplevelOutPath = discardStringCtx hostConfig.system.build.toplevel.outPath;
|
toplevelOutPath = discardStringCtx hostConfig.system.build.toplevel.outPath;
|
||||||
# let /var/lib/microvm/*/flake point to the flake-update branch so that
|
# let /var/lib/microvm/*/flake point to the flake-update branch so that
|
||||||
|
@ -254,21 +255,15 @@ lib.attrsets.mapAttrs
|
||||||
exit 2
|
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
|
${hostConfig.system.build.runOnServer} bash -e <<END
|
||||||
set -eou pipefail
|
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}
|
${createDirsCopyCurrent name}
|
||||||
|
ln -sfT ${declaredRunnerOutPath} current
|
||||||
ln -sfT ${hostConfig.microvm.declaredRunner} current
|
|
||||||
echo '${selfRef}' > flake
|
echo '${selfRef}' > flake
|
||||||
|
|
||||||
${createSymlinks name}
|
${createSymlinks name}
|
||||||
|
|
||||||
systemctl restart microvm@${name}.service
|
systemctl restart microvm@${name}.service
|
||||||
|
|
Loading…
Reference in New Issue