nixos/proxmox-lxc: fix nixos-rebuild

Same is being done in lxc-container module.
This commit is contained in:
Franz Pletz 2024-07-20 16:16:21 +02:00
parent c501d3fa97
commit ceafec213f
No known key found for this signature in database
GPG Key ID: 846FDED7792617B4

View File

@ -64,6 +64,18 @@ with lib;
extraCommands = "mkdir -p root etc/systemd/network";
};
boot.postBootCommands = ''
# After booting, register the contents of the Nix store in the Nix
# database.
if [ -f /nix-path-registration ]; then
${config.nix.package.out}/bin/nix-store --load-db < /nix-path-registration &&
rm /nix-path-registration
fi
# nixos-rebuild also requires a "system" profile
${config.nix.package.out}/bin/nix-env -p /nix/var/nix/profiles/system --set /run/current-system
'';
boot = {
isContainer = true;
loader.initScript.enable = true;