1
1
Fork 1
mirror of https://github.com/oddlama/nix-config.git synced 2025-10-11 07:10:39 +02:00

fix: add yubikey gpg keygrips to avoid having to call gpg --card-status each boot

This commit is contained in:
oddlama 2024-06-13 12:52:03 +02:00
parent 4b68bec5bb
commit aa659fa085
No known key found for this signature in database
GPG key ID: 14EFE510775FE39A
5 changed files with 14 additions and 0 deletions

View file

@ -1,8 +1,16 @@
{
lib,
nixosConfig,
pkgs,
...
}: {
# Make sure the keygrips exist, otherwise we'd need to run `gpg --card-status`
# before being able to use the yubikey.
home.activation.installKeygrips = lib.hm.dag.entryAfter ["writeBoundary"] ''
run mkdir -p "$HOME/.gnupg/private-keys-v1.d"
run ${lib.getExe pkgs.gnutar} xvf ${lib.escapeShellArg nixosConfig.age.secrets."my-gpg-yubikey-keygrip.tar".path} -C "$HOME/.gnupg/private-keys-v1.d/"
'';
programs.gpg = {
enable = true;
scdaemonSettings.disable-ccid = true;