mirror of
https://github.com/nix-community/disko
synced 2024-11-10 06:14:14 +00: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
1 changed files with 6 additions and 1 deletions
|
@ -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 a new issue