initrd: make keyfile optional

This commit is contained in:
teutat3s 2021-10-23 23:29:09 +02:00
parent 0bfe4a135e
commit 27aab3e540
Signed by untrusted user: teutat3s
GPG key ID: 4FA1D3FA524F22C1

View file

@ -23,7 +23,7 @@ with lib; {
# Use Keyfile to unlock the root partition to avoid keying in twice.
# Allow fstrim to work on it.
boot.initrd = {
boot.initrd = mkIf cfg.enableBootLoader {
secrets = { "/keyfile.bin" = cfg.keyfile; };
luks.devices."cryptroot" = {
keyFile = "/keyfile.bin";