Fix closureInfo copy
This commit is contained in:
parent
3528b38842
commit
3fc74479c3
11
packages.nix
11
packages.nix
|
@ -202,16 +202,19 @@ lib.attrsets.mapAttrs
|
||||||
|
|
||||||
"microvm-update-${name}" = pkgs.writeScriptBin "microvm-update-${name}" (
|
"microvm-update-${name}" = pkgs.writeScriptBin "microvm-update-${name}" (
|
||||||
if builtins.elem (hostConfig.c3d2.deployment.server or null) [ "server9" "server10" ]
|
if builtins.elem (hostConfig.c3d2.deployment.server or null) [ "server9" "server10" ]
|
||||||
then ''
|
then let
|
||||||
|
closureInfo = pkgs.closureInfo { rootPaths = [ hostConfig.system.build.toplevel.outPath ]; };
|
||||||
|
in ''
|
||||||
set -eou pipefail
|
set -eou pipefail
|
||||||
|
|
||||||
${hostConfig.system.build.copyToServer} ${declaredRunnerDrvPath}
|
${hostConfig.system.build.copyToServer} ${declaredRunnerDrvPath} ${discardStringCtx closureInfo.drvPath}
|
||||||
|
|
||||||
${hostConfig.system.build.runOnServer} NIXOS_REBUILD="''${NIXOS_REBUILD:-}" bash -e <<END
|
${hostConfig.system.build.runOnServer} NIXOS_REBUILD="''${NIXOS_REBUILD:-}" bash -e <<END
|
||||||
set -eou pipefail
|
set -eou pipefail
|
||||||
${createDirsCopyCurrent name}
|
${createDirsCopyCurrent name}
|
||||||
|
|
||||||
nix build -L --accept-flake-config -o current ${declaredRunnerDrvPath}
|
nix build -L --accept-flake-config -o current ${declaredRunnerDrvPath}
|
||||||
|
nix build -L --accept-flake-config --no-link ${discardStringCtx closureInfo.drvPath}
|
||||||
echo '${selfRef}' > flake
|
echo '${selfRef}' > flake
|
||||||
|
|
||||||
${createSymlinks name}
|
${createSymlinks name}
|
||||||
|
@ -222,7 +225,7 @@ lib.attrsets.mapAttrs
|
||||||
fi
|
fi
|
||||||
END
|
END
|
||||||
|
|
||||||
if [[ -n ''${NIXOS_REBUILD:-} ]]; then
|
if [[ -n \''${NIXOS_REBUILD:-} ]]; then
|
||||||
echo "Switching to configuration..."
|
echo "Switching to configuration..."
|
||||||
ssh ${target} bash -e <<END
|
ssh ${target} bash -e <<END
|
||||||
set -eou pipefail
|
set -eou pipefail
|
||||||
|
@ -234,7 +237,7 @@ lib.attrsets.mapAttrs
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# refresh nix db which is required for nix-env -p ... --set
|
# refresh nix db which is required for nix-env -p ... --set
|
||||||
${discardStringCtx hostConfig.nix.package}/bin/nix-store --load-db < ${discardStringCtx (pkgs.closureInfo { rootPaths = [ hostConfig.system.build.toplevel.outPath ]; })}
|
${discardStringCtx hostConfig.nix.package}/bin/nix-store --load-db < ${discardStringCtx closureInfo}
|
||||||
${discardStringCtx hostConfig.nix.package}/bin/nix-env -p /nix/var/nix/profiles/system --set ${toplevelOutPath}
|
${discardStringCtx hostConfig.nix.package}/bin/nix-env -p /nix/var/nix/profiles/system --set ${toplevelOutPath}
|
||||||
${toplevelOutPath}/bin/switch-to-configuration "''${@:-switch}"
|
${toplevelOutPath}/bin/switch-to-configuration "''${@:-switch}"
|
||||||
END
|
END
|
||||||
|
|
Loading…
Reference in New Issue