+ hostPkgs = config.virtualisation.host.pkgs;
+
+ storeContents =
+ hostPkgs.closureInfo { rootPaths = config.virtualisation.additionalPaths; };
+
+ nixStoreImages = {
+ ext4 = "${
+ import (modulesPath + "/../lib/make-disk-image.nix") {
+ inherit pkgs config lib;
+ additionalPaths = [ storeContents ];
+ onlyNixStore = true;
+ label = "nix-store";
+ partitionTableType = "none";
+ installBootLoader = false;
+ diskSize = "auto";
+ additionalSpace = "0M";
+ copyChannel = false;
+ }
+ }/nixos.img";
+ erofs = "${
+ hostPkgs.runCommand "nix-store-image" { } ''
+ mkdir $out
+ ${hostPkgs.gnutar}/bin/tar --create \
+ --absolute-names \
+ --verbatim-files-from \
+ --transform 'flags=rSh;s|/nix/store/||' \
+ --files-from ${storeContents}/store-paths \
+ | ${hostPkgs.erofs-utils}/bin/mkfs.erofs \
+ --force-uid=0 \
+ --force-gid=0 \
+ -L nix-store \
+ -U eb176051-bd15-49b7-9e6b-462e0b467019 \
+ -T 0 \
+ --tar=f \
+ $out/nix-store.img
+ ''
+ }/nix-store.img";
+ squashfs =
+ "${hostPkgs.callPackage (modulesPath + "/../lib/make-squashfs.nix") {
+ storeContents = config.virtualisation.additionalPaths;
+ }}";
+ };
+