File tree Expand file tree Collapse file tree 1 file changed +26
-14
lines changed Expand file tree Collapse file tree 1 file changed +26
-14
lines changed Original file line number Diff line number Diff line change 7
7
8
8
kernelAtLeast = lib . versionAtLeast config . boot . kernelPackages . kernel . version ;
9
9
10
- erofsFlags = builtins . concatStringsSep " " (
11
- [ "-zlz4hc" "--force-uid=0" "--force-gid=0" ]
12
- # ++
13
- # lib.optional (kernelAtLeast "5.13") "-C1048576"
14
- ++
15
- lib . optional ( kernelAtLeast "5.16" ) "-Eztailpacking"
16
- ++
17
- lib . optionals ( kernelAtLeast "6.1" ) [
18
- "-Efragments"
19
- # "-Ededupe"
20
- ]
21
- ) ;
10
+ erofsFlags = builtins . concatStringsSep " " config . microvm . storeDiskErofsFlags ;
11
+ squashfsFlags = builtins . concatStringsSep " " config . microvm . storeDiskSquashfsFlags ;
22
12
23
13
writeClosure = pkgs . writeClosure or pkgs . writeReferencesToFile ;
24
14
32
22
'' ;
33
23
} ;
34
24
25
+ storeDiskErofsFlags = mkOption {
26
+ type = with types ; listOf str ;
27
+ default =
28
+ [
29
+ "-zlz4hc"
30
+ ]
31
+ # ++
32
+ # lib.optional (kernelAtLeast "5.13") "-C1048576"
33
+ ++
34
+ lib . optional ( kernelAtLeast "5.16" ) "-Eztailpacking"
35
+ ++
36
+ lib . optionals ( kernelAtLeast "6.1" ) [
37
+ "-Efragments"
38
+ # "-Ededupe"
39
+ ] ;
40
+ } ;
41
+
42
+ storeDiskSquashfsFlags = mkOption {
43
+ type = with types ; listOf str ;
44
+ default = [ "-c" "zstd" ] ;
45
+ } ;
46
+
35
47
storeDisk = mkOption {
36
48
type = types . path ;
37
49
description = ''
81
93
82
94
echo Creating a ${ config . microvm . storeDiskType }
83
95
${ {
84
- squashfs = "gensquashfs -D store --all-root -c zstd -q $out" ;
85
- erofs = "mkfs.erofs ${ erofsFlags } -L nix-store --mount-point=/nix/store $out store" ;
96
+ squashfs = "gensquashfs -D store --all-root -q ${ squashfsFlags } $out" ;
97
+ erofs = "mkfs.erofs ${ erofsFlags } -T 0 --all-root - L nix-store --mount-point=/nix/store $out store" ;
86
98
} . ${ config . microvm . storeDiskType } }
87
99
'' ;
88
100
} )
You can’t perform that action at this time.
0 commit comments