Fix NIXOS_REBUILD=1 microvm deployment
This commit is contained in:
parent
03e0cd2fbd
commit
4ee5447414
|
@ -102,6 +102,7 @@ with final; {
|
|||
stable = (prev.nixVersions.stable.override { withAWS = false; }).overrideAttrs ({ patches ? [ ], ...}: {
|
||||
patches = patches ++ [
|
||||
# request compression
|
||||
# TODO: drop with 23.11
|
||||
(fetchpatch {
|
||||
url = "https://github.com/NixOS/nix/pull/7712.patch";
|
||||
sha256 = "sha256-mAx2h0/r7HayvTjMMxmewaD+L4OOB2gRJaQb3JEb0rk=";
|
||||
|
|
|
@ -202,7 +202,7 @@ lib.attrsets.mapAttrs
|
|||
"microvm-update-${name}" = pkgs.writeScriptBin "microvm-update-${name}" (
|
||||
if builtins.elem (hostConfig.c3d2.deployment.server or null) [ "server9" "server10" ]
|
||||
then let
|
||||
closureInfo = pkgs.closureInfo { rootPaths = [ hostConfig.system.build.toplevel.outPath ]; };
|
||||
closureInfo = pkgs.closureInfo { rootPaths = [ hostConfig.system.build.toplevel ]; };
|
||||
in ''
|
||||
set -eou pipefail
|
||||
|
||||
|
@ -235,7 +235,7 @@ lib.attrsets.mapAttrs
|
|||
fi
|
||||
|
||||
# refresh nix db which is required for nix-env -p ... --set
|
||||
${discardStringCtx hostConfig.nix.package}/bin/nix-store --load-db < ${discardStringCtx closureInfo}
|
||||
${discardStringCtx hostConfig.nix.package}/bin/nix-store --load-db < ${discardStringCtx closureInfo}/registration
|
||||
${discardStringCtx hostConfig.nix.package}/bin/nix-env -p /nix/var/nix/profiles/system --set ${toplevelOutPath}
|
||||
${toplevelOutPath}/bin/switch-to-configuration "''${@:-switch}"
|
||||
END
|
||||
|
|
Loading…
Reference in New Issue