diff --git a/modules/programs/aerc-accounts.nix b/modules/programs/aerc-accounts.nix index 6a6153e5..c84c5f4b 100644 --- a/modules/programs/aerc-accounts.nix +++ b/modules/programs/aerc-accounts.nix @@ -230,7 +230,14 @@ in { else { }; + pgpCfg = account: { + "pgp-auto-sign" = account.gpg.signByDefault; + "pgp-opportunistic-encrypt" = account.gpg.encryptByDefault; + "pgp-key-id" = account.gpg.key; + }; + in (basicCfg account) // (sourceCfg account) // (outgoingCfg account) + // lib.optionalAttrs (!isNull account.gpg) (pgpCfg account) // account.aerc.extraAccounts; mkAccountConfig = name: account: diff --git a/tests/modules/programs/aerc/extraAccounts.expected b/tests/modules/programs/aerc/extraAccounts.expected index 0697d961..d53cfea9 100644 --- a/tests/modules/programs/aerc/extraAccounts.expected +++ b/tests/modules/programs/aerc/extraAccounts.expected @@ -91,3 +91,9 @@ from = test outgoing = imap+plain://intentionallyWrong:PaSsWorD@smtp.host.invalid:1337 postpone = dRaFts source = smtp+plain://intentionallyWrong:PaSsWorD@smtp.host.invalid:1337 + +[q_gpg] +from = Foo Bar +pgp-auto-sign = true +pgp-key-id = 00112233445566778899AABBCCDDEEFF +pgp-opportunistic-encrypt = true diff --git a/tests/modules/programs/aerc/settings.nix b/tests/modules/programs/aerc/settings.nix index af4d16f7..0ed2cfb5 100644 --- a/tests/modules/programs/aerc/settings.nix +++ b/tests/modules/programs/aerc/settings.nix @@ -260,6 +260,13 @@ with lib; }; }; }; + q_gpg = basics // { + gpg = { + signByDefault = true; + encryptByDefault = true; + key = "00112233445566778899AABBCCDDEEFF"; + }; + }; }; }; }