Skip to content

Commit 266bb49

Browse files
SuperSandro2000astro
authored andcommitted
Add option to disable toplevel symlink in microvm
This removes the last reference to uncompressed store content when using erofs.
1 parent c978acc commit 266bb49

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

doc/src/conventions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ MicroVM deployments using the information on this page.
1414
| `microvm.devices.*.path` | `share/microvm/pci-devices` | `[email protected]` | PCI devices that must be bound to the **vfio-pci** driver on the host |
1515
| `microvm.shares.*.source` | `share/microvm/virtiofs/${tag}/source` | `[email protected]` | Source directory of a **virtiofs** instance by tag |
1616
| `microvm.shares.*.socket` | `share/microvm/virtiofs/${tag}/socket` | `[email protected]` | **virtiofsd** socket path by tag |
17-
| | `share/microvm/system` | | `config.system.build.toplevel` symlink, used for comparing versions when running `microvm -l` |
17+
| `microvm.systemSymlink` | `share/microvm/system` | | `config.system.build.toplevel` symlink, used for comparing versions when running `microvm -l` |
1818

1919

2020
## Generating custom operating system hypervisor packages

lib/runner.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ pkgs.buildPackages.runCommand "microvm-${microvmConfig.hypervisor}-${hostName}"
7272
'') (builtins.attrNames binScriptPkgs)}
7373
7474
mkdir -p $out/share/microvm
75+
${lib.optionalString microvmConfig.systemSymlink ''
7576
ln -s ${toplevel} $out/share/microvm/system
77+
''}
7678
7779
echo vnet_hdr > $out/share/microvm/tap-flags
7880
${lib.optionalString tapMultiQueue ''

nixos-modules/microvm/options.nix

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,15 @@ in
602602
description = "Flags to pass to gensquashfs";
603603
default = [ "-c" "zstd" "-j" "$NIX_BUILD_CORES" ];
604604
};
605+
606+
systemSymlink = mkOption {
607+
type = types.bool;
608+
default = !config.microvm.storeOnDisk;
609+
description = ''
610+
Whether to inclcude a symlink of `config.system.build.toplevel` to `share/microvm/system`.
611+
This is required for commands like `microvm -l` to function but removes reference to the uncompressed store content when using a disk image for the nix store.
612+
'';
613+
};
605614
};
606615

607616
config = lib.mkMerge [ {

0 commit comments

Comments
 (0)