File tree Expand file tree Collapse file tree 5 files changed +35
-11
lines changed Expand file tree Collapse file tree 5 files changed +35
-11
lines changed Original file line number Diff line number Diff line change 2929 description = "Declare the type of the primary partition" ;
3030 } ;
3131
32- swapSize = mkOption {
33- type = types . nullOr types . str ;
34- default = "32G" ;
35- example = "32768M" ;
36- description = "The size of the hard disk space used when RAM is full" ;
32+ swap = {
33+ size = mkOption {
34+ type = types . nullOr types . str ;
35+ default = "32G" ;
36+ example = "32768M" ;
37+ description = "The size of the hard disk space used when RAM is full" ;
38+ } ;
39+
40+ randomEncryption = mkOption {
41+ type = types . bool ;
42+ default = true ;
43+ example = false ;
44+ description = "Whether to use random encryption for swap partition" ;
45+ } ;
3746 } ;
3847
3948 espSize = mkOption {
162171 inherit disk lib ;
163172 isSecondary = true ;
164173 espSize = cfg . espSize ;
165- swapSize = cfg . swapSize ;
174+ swapSize = cfg . swap . size ;
166175 partitioningPreset = cfg . partitioningPreset ;
167176 poolName = cfg . zpool . name ;
177+ randomEncryption = cfg . swap . randomEncryption ;
168178 }
169179 else
170180 makeSecondaryZfsDisk {
183193 disk = first ;
184194 isSecondary = false ;
185195 espSize = cfg . espSize ;
186- swapSize = cfg . swapSize ;
196+ swapSize = cfg . swap . size ;
187197 partitioningPreset = cfg . partitioningPreset ;
188198 poolName = cfg . zpool . name ;
199+ randomEncryption = cfg . swap . randomEncryption ;
189200 } ;
190201 } ;
191202 zpool = import ./zpool.nix {
Original file line number Diff line number Diff line change 66 swapSize ,
77 partitioningPreset ,
88 poolName ,
9+ randomEncryption ,
910} :
1011{
1112 type = "disk" ;
2122 espSize
2223 swapSize
2324 poolName
25+ randomEncryption
2426 ;
2527 }
2628 else if partitioningPreset == "ext4" then
27- import ./ext4.nix { inherit lib espSize swapSize ; }
29+ import ./ext4.nix {
30+ inherit
31+ lib
32+ espSize
33+ swapSize
34+ randomEncryption
35+ ;
36+ }
2837 else
2938 import ./zfs.nix {
3039 inherit
3443 espSize
3544 swapSize
3645 poolName
46+ randomEncryption
3747 ;
3848 } ;
3949 }
Original file line number Diff line number Diff line change 22 lib ,
33 espSize ,
44 swapSize ,
5+ randomEncryption ,
56} :
67{
78 ESP = {
3334 size = swapSize ;
3435 content = {
3536 type = "swap" ;
36- randomEncryption = true ;
37+ inherit randomEncryption ;
3738 } ;
3839 } ;
3940}
Original file line number Diff line number Diff line change 44 espSize ,
55 swapSize ,
66 poolName ,
7+ randomEncryption ,
78} :
89[
910 {
4344 part-type = "primary" ;
4445 content = {
4546 type = "swap" ;
46- randomEncryption = true ;
47+ inherit randomEncryption ;
4748 } ;
4849 }
4950]
Original file line number Diff line number Diff line change 55 espSize ,
66 swapSize ,
77 poolName ,
8+ randomEncryption ,
89} :
910{
1011 "ESP" = {
3839 size = swapSize ;
3940 content = {
4041 type = "swap" ;
41- randomEncryption = true ;
42+ inherit randomEncryption ;
4243 } ;
4344 } ;
4445}
You can’t perform that action at this time.
0 commit comments