···11+{ lib, wrapFirefox, gpgme, gnupg }:
22+33+browser:
44+args:
55+66+(wrapFirefox browser ({
77+ libName = "thunderbird";
88+} // args))
99+1010+.overrideAttrs (old: {
1111+ # Thunderbird's native GPG support does not yet support smartcards.
1212+ # The official upstream recommendation is to configure fall back to gnupg
1313+ # using the Thunderbird config `mail.openpgp.allow_external_gnupg`
1414+ # and GPG keys set up; instructions with pictures at:
1515+ # https://anweshadas.in/how-to-use-yubikey-or-any-gpg-smartcard-in-thunderbird-78/
1616+ # For that to work out of the box, it requires `gnupg` on PATH and
1717+ # `gpgme` in `LD_LIBRARY_PATH`; we do this below.
1818+ buildCommand = old.buildCommand + ''
1919+ wrapProgram $out/bin/thunderbird \
2020+ --prefix LD_LIBRARY_PATH ':' "${lib.makeLibraryPath [ gpgme ]}" \
2121+ --prefix PATH ':' "${lib.makeBinPath [ gnupg ]}"
2222+ '';
2323+})