I am using NixOS. I want to use pam-gnupg with slock. How can I make unlocking slock also unlock my gpg key?
Part of configuration.nix:
programs.gnupg.agent = { enable = true; enableSSHSupport = true; };
security = {
pam = {
services =
let defaults = {
gnupg = {
enable = true;
noAutostart = true;
storeOnly = true;
};
};
in {
login = defaults;
slock = defaults;
};
};
};
Part of home.nix:
programs.gpg.enable = true;
home.file.".pam-gnupg".text = "6869706F69657774726F736B696B646E74736972";
services.gpg-agent = {
enable = true;
defaultCacheTtl = 54000;
maxCacheTtl = 54000;
extraConfig = ''
allow-preset-passphrase
'';
};