luks: use allowDiscards option

This commit is contained in:
Felix Buehler 2023-11-04 12:54:07 +01:00 committed by mergify[bot]
parent 944d338d24
commit 548962c50b
4 changed files with 17 additions and 11 deletions

View file

@ -24,11 +24,13 @@
content = {
type = "luks";
name = "crypted";
extraOpenArgs = [ "--allow-discards" ];
# if you want to use the key for interactive login be sure there is no trailing newline
# for example use `echo -n "password" > /tmp/secret.key`
#passwordFile = "/tmp/secret.key"; # Interactive
settings.keyFile = "/tmp/secret.key";
settings = {
allowDiscards = true;
# if you want to use the key for interactive login be sure there is no trailing newline
# for example use `echo -n "password" > /tmp/secret.key`
#passwordFile = "/tmp/secret.key"; # Interactive
keyFile = "/tmp/secret.key";
};
additionalKeyFiles = [ "/tmp/additionalSecret.key" ];
content = {
type = "btrfs";

View file

@ -21,7 +21,7 @@
content = {
type = "luks";
name = "crypted";
extraOpenArgs = [ "--allow-discards" ];
settings.allowDiscards = true;
passwordFile = "/tmp/secret.key";
content = {
type = "filesystem";

View file

@ -24,10 +24,13 @@
content = {
type = "luks";
name = "crypted";
extraOpenArgs = [ "--allow-discards" ];
# if you want to use the key for interactive login be sure there is no trailing newline
# for example use `echo -n "password" > /tmp/secret.key`
settings.keyFile = "/tmp/secret.key";
extraOpenArgs = [ ];
settings = {
# if you want to use the key for interactive login be sure there is no trailing newline
# for example use `echo -n "password" > /tmp/secret.key`
keyFile = "/tmp/secret.key";
allowDiscards = true;
};
additionalKeyFiles = [ "/tmp/additionalSecret.key" ];
content = {
type = "lvm_pv";

View file

@ -62,6 +62,7 @@ in
keyFileSize = 2048;
keyFileOffset = 1024;
fallbackToPassword = true;
allowDiscards = true;
};
'';
};
@ -86,7 +87,7 @@ in
type = lib.types.listOf lib.types.str;
default = [ ];
description = "Extra arguments to pass to `cryptsetup luksOpen` when opening";
example = [ "--allow-discards" ];
example = [ "--timeout 10" ];
};
content = diskoLib.deviceType { parent = config; device = "/dev/mapper/${config.name}"; };
_parent = lib.mkOption {