Commit 3d4f3068 authored by David McFarland's avatar David McFarland
Browse files

nixos/gnupg: fix gpg-agent when pinentryFlavor is null

8ea64499 moved the configuration outside
the pinentryFlavor check, causing evaluation to fail when it was set to
null.

960a5142 removed the upstream systemd
units, causing gpg-agent.service to be conditional on pinentryFlavor.
parent 3cf96bff
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -94,12 +94,13 @@ in
  };

  config = mkIf cfg.agent.enable {
    environment.etc."gnupg/gpg-agent.conf".text = ''
    environment.etc."gnupg/gpg-agent.conf".text =
      lib.optionalString (cfg.agent.pinentryFlavor != null) ''
      pinentry-program ${pkgs.pinentry.${cfg.agent.pinentryFlavor}}/bin/pinentry
    '';

    # This overrides the systemd user unit shipped with the gnupg package
    systemd.user.services.gpg-agent = mkIf (cfg.agent.pinentryFlavor != null) {
    systemd.user.services.gpg-agent = {
      unitConfig = {
        Description = "GnuPG cryptographic agent and passphrase cache";
        Documentation = "man:gpg-agent(1)";