mirror of
https://github.com/nix-community/disko.git
synced 2026-11-30 13:03:28 +01:00
swap: forward discardPolicy option to randomEncryption.allowDiscards
I.e. instead of effectively ignoring `discardPolicy` when combined with `randomEncryption`, or adding a second option requiring the user to repeat themselves (DRY violation), just enable both when requested via `discardPolicy`. Without this `discardPolicy` is a NOP when `randomEncryption` is enabled.
This commit is contained in:
1 parent
e972a78f4a
commit
f236f6df36
1 file changed
+6
-1
+6
-1
@@ -92,7 +92,12 @@
|
||||
default = [{
|
||||
swapDevices = [{
|
||||
device = config.device;
|
||||
inherit (config) discardPolicy priority randomEncryption;
|
||||
inherit (config) discardPolicy priority;
|
||||
randomEncryption = {
|
||||
enable = config.randomEncryption;
|
||||
# forward discard/TRIM attempts through dm-crypt
|
||||
allowDiscards = config.discardPolicy != null;
|
||||
};
|
||||
}];
|
||||
boot.resumeDevice = lib.mkIf config.resumeDevice config.device;
|
||||
}];
|
||||
|
||||
Reference in new issue
Block a user