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 ? [ ], ...}: {
|
stable = (prev.nixVersions.stable.override { withAWS = false; }).overrideAttrs ({ patches ? [ ], ...}: {
|
||||||
patches = patches ++ [
|
patches = patches ++ [
|
||||||
# request compression
|
# request compression
|
||||||
|
# TODO: drop with 23.11
|
||||||
(fetchpatch {
|
(fetchpatch {
|
||||||
url = "https://github.com/NixOS/nix/pull/7712.patch";
|
url = "https://github.com/NixOS/nix/pull/7712.patch";
|
||||||
sha256 = "sha256-mAx2h0/r7HayvTjMMxmewaD+L4OOB2gRJaQb3JEb0rk=";
|
sha256 = "sha256-mAx2h0/r7HayvTjMMxmewaD+L4OOB2gRJaQb3JEb0rk=";
|
||||||
|
|
|
@ -202,7 +202,7 @@ 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 let
|
then let
|
||||||
closureInfo = pkgs.closureInfo { rootPaths = [ hostConfig.system.build.toplevel.outPath ]; };
|
closureInfo = pkgs.closureInfo { rootPaths = [ hostConfig.system.build.toplevel ]; };
|
||||||
in ''
|
in ''
|
||||||
set -eou pipefail
|
set -eou pipefail
|
||||||
|
|
||||||
|
@ -235,7 +235,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 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}
|
${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