GPG key management with Yubikey

Hello!

I have my public GPG key on a keyserver and my private key on a Yubikey. Normal process whenever I’m using a new machine is to download the public key, gpg --import it, then gpg --card-status to get everything properly set-up.

Is there a way I can include my public key in my NixOS config so that all I need to do is gpg --card-status without worrying about pulling down my key and importing it manually?

You may be interested in the programs.gpg.publicKeys home-manager option

A list of public keys to be imported into GnuPG. Note, these key files will be copied into the world-readable Nix store.

3 Likes