···
8
+
randomEncryptionCoerce = enable: { inherit enable; };
10
+
randomEncryptionOpts = { ... }: {
18
+
Encrypt swap device with a random key. This way you won't have a persistent swap device.
20
+
WARNING: Don't try to hibernate when you have at least one swap partition with
21
+
this option enabled! We have no way to set the partition into which hibernation image
22
+
is saved, so if your image ends up on an encrypted one you would lose it!
24
+
WARNING #2: Do not use /dev/disk/by-uuid/… or /dev/disk/by-label/… as your swap device
25
+
when using randomEncryption as the UUIDs and labels will get erased on every boot when
26
+
the partition is encrypted. Best to use /dev/disk/by-partuuid/…
31
+
default = "aes-xts-plain64";
32
+
example = "serpent-xts-plain64";
35
+
Use specified cipher for randomEncryption.
37
+
Hint: Run "cryptsetup benchmark" to see which one is fastest on your machine.
42
+
default = "/dev/urandom";
43
+
example = "/dev/random";
46
+
Define the source of randomness to obtain a random key for encryption.
swapCfg = {config, options, ...}: {
···
48
-
randomEncryption.enable = mkOption {
94
+
randomEncryption = mkOption {
98
+
cipher = "serpent-xts-plain64";
99
+
source = "/dev/random";
101
+
type = types.coercedTo types.bool randomEncryptionCoerce (types.submodule randomEncryptionOpts);
Encrypt swap device with a random key. This way you won't have a persistent swap device.
105
+
HINT: run "cryptsetup benchmark" to test cipher performance on your machine.
WARNING: Don't try to hibernate when you have at least one swap partition with
this option enabled! We have no way to set the partition into which hibernation image
···
WARNING #2: Do not use /dev/disk/by-uuid/… or /dev/disk/by-label/… as your swap device
when using randomEncryption as the UUIDs and labels will get erased on every boot when
the partition is encrypted. Best to use /dev/disk/by-partuuid/…
64
-
randomEncryption.cipher = mkOption {
65
-
default = "aes-xts-plain64";
66
-
example = "serpent-xts-plain64";
69
-
Use specified cipher for randomEncryption.
71
-
Hint: Run "cryptsetup benchmark" to see which one is fastest on your machine.
75
-
randomEncryption.source = mkOption {
76
-
default = "/dev/urandom";
77
-
example = "/dev/random";
80
-
Define the source of randomness to obtain a random key for encryption.