From 75fe718992fc3827d6676e7d90db567c8093bb7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Mon, 13 Nov 2023 23:55:45 +0100 Subject: [PATCH] Properly update profile when not rebooting microvm --- packages.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 <