mirror of
https://github.com/nix-community/disko.git
synced 2024-09-10 22:15:54 +03: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:
parent
e972a78f4a
commit
f236f6df36
@ -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;
|
||||
}];
|
||||
|
Loading…
Reference in New Issue
Block a user