Refactor gnupg+pinentry installation
Ensure pinentry-gtk-2 is used so we can theme its prompt, and ensure that gpg respects XDG conventions.
This commit is contained in:
parent
eec332814a
commit
0ec23ed5f0
|
@ -1,13 +1,32 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
environment.systemPackages = with pkgs; [
|
environment = {
|
||||||
gnupg
|
extraInit = ''
|
||||||
pinentry
|
export GNUPGHOME="$XDG_CONFIG_HOME/gnupg"
|
||||||
];
|
if [ ! -d "$GNUPGHOME" ]; then
|
||||||
|
mkdir -p "$GNUPGHOME" -m 700
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
|
||||||
|
systemPackages = with pkgs; [
|
||||||
|
gnupg
|
||||||
|
pinentry
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
programs.gnupg.agent = {
|
programs.gnupg.agent = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enableSSHSupport = true;
|
enableSSHSupport = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
systemd.user.services.gpg-agent.serviceConfig.ExecStart = [
|
||||||
|
"" ''
|
||||||
|
${pkgs.gnupg}/bin/gpg-agent \
|
||||||
|
--supervised \
|
||||||
|
--allow-emacs-pinentry \
|
||||||
|
--default-cache-ttl 1200 \
|
||||||
|
--pinentry-program ${pkgs.pinentry}/bin/pinentry-gtk-2
|
||||||
|
''
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue