diff --git a/packages.nix b/packages.nix index 2406676a..ae08af79 100644 --- a/packages.nix +++ b/packages.nix @@ -232,6 +232,10 @@ lib.attrsets.mapAttrs echo "hostname of ${target} was expected to be ${name} but is \$hostname. Aborting to be safe..." exit 2 fi + + # 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-env -p /nix/var/nix/profiles/system --set ${toplevelOutPath} ${toplevelOutPath}/bin/switch-to-configuration "''${@:-switch}" END # ^ yes, this is required to be like this @@ -253,6 +257,12 @@ lib.attrsets.mapAttrs ${hostConfig.system.build.runOnServer} bash -e <