add luks.extraArgs

This commit is contained in:
lassulus 2018-07-25 01:26:25 +02:00
parent 0e8c5d1e67
commit e8f7aa94c2
2 changed files with 5 additions and 1 deletions

View file

@ -29,6 +29,10 @@
algo = "aes-xts...";
name = "crypted";
keyfile = "/tmp/secret.key";
extraArgs = [
"--hash sha512"
"--iter-time 5000"
];
content = {
type = "lvm";
name = "pool";

View file

@ -43,7 +43,7 @@ let {
'';
create.luks = q: x: ''
cryptsetup -q luksFormat ${q.device} ${x.keyfile}
cryptsetup -q luksFormat ${q.device} ${x.keyfile} ${toString (x.extraArgs or [])}
cryptsetup luksOpen ${q.device} ${x.name} --key-file ${x.keyfile}
${body.create { device = "/dev/mapper/${x.name}"; } x.content}
'';