1 { config, lib, modulesPath, pkgs, ... }:
3 inherit (lib) findSingle mkForce mkIf mkMerge mkVMOverride;
5 lookupDriveDeviceName = driveName: driveList:
6 (findSingle (drive: drive.name == driveName)
7 (throw "Drive ${driveName} not found")
8 (throw "Multiple drives named ${driveName}") driveList).device;
10 storeMountPath = if config.virtualisation.writableStore then
17 boot.initrd.availableKernelModules = [ "squashfs" ];
19 fileSystems = mkVMOverride {
20 "${storeMountPath}" = {
22 lookupDriveDeviceName "nixstore" config.virtualisation.qemu.drives;
29 system.build.squashfsStore =
30 pkgs.callPackage (modulesPath + "/../lib/make-squashfs.nix") {
31 storeContents = config.virtualisation.additionalPaths;
36 sharedDirectories = mkForce { };
40 file = "${config.system.build.squashfsStore}";