···1+{ lib, wrapFirefox, gpgme, gnupg }:
2+3+browser:
4+args:
5+6+(wrapFirefox browser ({
7+ libName = "thunderbird";
8+} // args))
9+10+.overrideAttrs (old: {
11+ # Thunderbird's native GPG support does not yet support smartcards.
12+ # The official upstream recommendation is to configure fall back to gnupg
13+ # using the Thunderbird config `mail.openpgp.allow_external_gnupg`
14+ # and GPG keys set up; instructions with pictures at:
15+ # https://anweshadas.in/how-to-use-yubikey-or-any-gpg-smartcard-in-thunderbird-78/
16+ # For that to work out of the box, it requires `gnupg` on PATH and
17+ # `gpgme` in `LD_LIBRARY_PATH`; we do this below.
18+ buildCommand = old.buildCommand + ''
19+ wrapProgram $out/bin/thunderbird \
20+ --prefix LD_LIBRARY_PATH ':' "${lib.makeLibraryPath [ gpgme ]}" \
21+ --prefix PATH ':' "${lib.makeBinPath [ gnupg ]}"
22+ '';
23+})