From 40d9b123a06007cafa3c7964303aba560f9c1bc6 Mon Sep 17 00:00:00 2001 From: Dmitriy Pleshevskiy Date: Fri, 19 Apr 2024 19:04:38 +0300 Subject: [PATCH] modules/aerc: add support of gpg files --- modules/home-manager/programs/aerc.nix | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/modules/home-manager/programs/aerc.nix b/modules/home-manager/programs/aerc.nix index aaafda9..ea5af38 100644 --- a/modules/home-manager/programs/aerc.nix +++ b/modules/home-manager/programs/aerc.nix @@ -26,11 +26,24 @@ in # See: https://git.sbruder.de/simon/nixos-config/src/branch/master/users/simon/modules/mail/aerc/default.nix programs.aerc = { enable = true; - package = pkgs.unstable.aerc; + package = pkgs.unstable.aerc.override { + # support .filename filter + buildGoModule = args: pkgs.unstable.buildGoModule (args // rec { + version = "6ffc0ed5991bef69a50cbc22647af0a6a0e0a895"; + src = pkgs.fetchFromSourcehut { + owner = "~rjarry"; + repo = "aerc"; + rev = version; + hash = "sha256-IyAcTCDSjOmZ6KPr9nYKdxWA0qryeU4jTwxRWzt2NOY="; + }; + vendorHash = "sha256-pir78zXidz7N9Z6uw9YqkkjVRUho0PuKgDTQFli/4fs="; + }); + }; # https://git.sr.ht/~rjarry/aerc/tree/master/item/doc/aerc-config.5.scd extraConfig = { general = { unsafe-accounts-conf = true; + pgp-provider = "gpg"; }; ui = { @@ -59,8 +72,12 @@ in "text/rfc822-headers" = "colorize"; # "text/*" = "${pkgs.bat}/bin/bat -fpp --file-name='$AERC_FILENAME'"; "message/delivery-status" = "cat | colorize"; + "application/pgp-keys" = "gpg"; + ".filename,~\\.gpg" = "gpg --decrypt"; }; + openers = { }; + hooks = { mail-received = "notify-send \"New mail from $AERC_FROM_NAME\" \"$AERC_SUBJECT\""; };