File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change 24
24
options . microvm = with lib ; {
25
25
storeDiskType = mkOption {
26
26
type = types . enum [ "squashfs" "erofs" ] ;
27
- # nixos/modules/profiles/hardened.nix forbids erofs
28
- default =
29
- if builtins . elem "erofs" config . boot . blacklistedKernelModules
30
- then "squashfs"
31
- else "erofs" ;
32
27
description = ''
33
28
Boot disk file system type: squashfs is smaller, erofs is supposed to be faster.
34
29
'' ;
44
39
45
40
config = lib . mkMerge [
46
41
( lib . mkIf ( config . microvm . guest . enable && config . microvm . storeOnDisk ) {
42
+ # nixos/modules/profiles/hardened.nix forbids erofs.
43
+ # HACK: Other NixOS modules populate
44
+ # config.boot.blacklistedKernelModules depending on the boot
45
+ # filesystems, so checking on that directly would result in an
46
+ # infinite recursion.
47
+ microvm . storeDiskType = lib . mkDefault (
48
+ if config . security . virtualisation . flushL1DataCache == "always"
49
+ then "squashfs"
50
+ else "erofs"
51
+ ) ;
47
52
boot . initrd . availableKernelModules = [
48
53
config . microvm . storeDiskType
49
54
] ;
You can’t perform that action at this time.
0 commit comments