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:
parent
4b68bec5bb
commit
aa659fa085
5 changed files with 14 additions and 0 deletions
Binary file not shown.
Binary file not shown.
|
@ -28,6 +28,12 @@ in
|
||||||
mode = "640";
|
mode = "640";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
age.secrets."my-gpg-yubikey-keygrip.tar" = {
|
||||||
|
rekeyFile = ./secrets/gpg-keygrip.tar.age;
|
||||||
|
group = myuser;
|
||||||
|
mode = "640";
|
||||||
|
};
|
||||||
|
|
||||||
home-manager.users.${myuser} = {
|
home-manager.users.${myuser} = {
|
||||||
imports = [
|
imports = [
|
||||||
../config
|
../config
|
||||||
|
|
|
@ -1,8 +1,16 @@
|
||||||
{
|
{
|
||||||
|
lib,
|
||||||
nixosConfig,
|
nixosConfig,
|
||||||
pkgs,
|
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 = {
|
programs.gpg = {
|
||||||
enable = true;
|
enable = true;
|
||||||
scdaemonSettings.disable-ccid = true;
|
scdaemonSettings.disable-ccid = true;
|
||||||
|
|
BIN
users/myuser/secrets/gpg-keygrip.tar.age
Normal file
BIN
users/myuser/secrets/gpg-keygrip.tar.age
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue