mirror of
https://github.com/aviallon/nixos-lib.git
synced 2026-04-05 17:27:50 +00:00
[Services/GnuPG] use pinentry package option
Greatly simplifies config.
This commit is contained in:
parent
eeae546d01
commit
d03e27beb6
1 changed files with 2 additions and 13 deletions
|
|
@ -4,13 +4,14 @@ let
|
|||
gpgNoTTY = pkgs.writeShellScriptBin "gpg-no-tty" ''
|
||||
exec ${pkgs.gnupg}/bin/gpg --batch --no-tty "$@"
|
||||
'';
|
||||
pinentrySwitcher = pkgs.callPackage ../packages/pinentry.nix {};
|
||||
in {
|
||||
config = {
|
||||
|
||||
programs.gnupg = {
|
||||
agent.enable = true;
|
||||
dirmngr.enable = true;
|
||||
agent.pinentryFlavor = "curses"; # overriden anyway
|
||||
agent.pinentryPackage = pinentrySwitcher;
|
||||
agent.enableSSHSupport = true;
|
||||
agent.enableExtraSocket = true;
|
||||
agent.enableBrowserSocket = true;
|
||||
|
|
@ -30,17 +31,5 @@ in {
|
|||
gpgNoTTY
|
||||
];
|
||||
|
||||
systemd.user.services.gpg-agent = let
|
||||
pinentrySwitcher = pkgs.callPackage ../packages/pinentry.nix {};
|
||||
cfg = config.programs.gnupg;
|
||||
in {
|
||||
restartTriggers = [ pinentrySwitcher ];
|
||||
restartIfChanged = true;
|
||||
|
||||
serviceConfig.ExecStart = mkOverride 30 [ "" ''
|
||||
${cfg.package}/bin/gpg-agent --supervised \
|
||||
--pinentry-program ${pinentrySwitcher}/bin/pinentry
|
||||
'' ];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue