Where to go from `boot.initrd.luks.gpgSupport`?

I have a few yubikeys configured to use the same gpg key and I currently use the following to unlock during boot

boot.initrd.luks.gpgSupport = true;
boot.initrd.luks.devices.“cryptroot”.device = “/dev/disk/by-uuid/…
boot.initrd.luks.devices.“cryptroot”.gpgCard.publicKey = ..;
boot.initrd.luks.devices.“cryptroot”.gpgCard.encryptedPass = ..;

IIUC correctly support for this will be removed with scripted initrd in 26.11.

Wondering if anyone is in a similar position and what they ended up doing and why.

I think I have the option of using piv (which will work both with my yubikey 4 and 5) or FIDO2 which is only supported by the yubikey v5. At first glance FIDO2 seems easier to configure except for having to enroll each yubikey.

2 Likes

Same position here. GPG support is a great feature that would be unfortunate to lose. There are no good alternatives as far as I can tell.

The supported options are those described in systemd-cryptenroll(1). Anything else is just out of scope and not reasonably maintainable in-tree in nixpkgs. cryptsetup does have a concept of plugins, and I think it would be a good idea for us to add more generic support for those, but AFAIK there aren’t plugins for the deprecated methods other than the fido2 / tpm2 / pkcs11 ones you get with systemd-cryptenroll.

If you want support for additional key acquisition methods, my recommendation is to file issues upstream with systemd about the method you’d like, or to create an out-of-tree cryptsetup plugin for it. In the latter case, NixOS still needs to implement a generic interface for integrating arbitrary cryptsetup plugins, but that would be a welcome change (unlike any specific in-tree implementations of key acquisition methods).

1 Like