about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/networking/mailreaders/thunderbird/wrapper.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/networking/mailreaders/thunderbird/wrapper.nix')
-rw-r--r--nixpkgs/pkgs/applications/networking/mailreaders/thunderbird/wrapper.nix23
1 files changed, 23 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/networking/mailreaders/thunderbird/wrapper.nix b/nixpkgs/pkgs/applications/networking/mailreaders/thunderbird/wrapper.nix
new file mode 100644
index 000000000000..0761232cc519
--- /dev/null
+++ b/nixpkgs/pkgs/applications/networking/mailreaders/thunderbird/wrapper.nix
@@ -0,0 +1,23 @@
+{ lib, wrapFirefox, gpgme, gnupg }:
+
+browser:
+args:
+
+(wrapFirefox browser ({
+  libName = "thunderbird";
+} // args))
+
+.overrideAttrs (old: {
+  # Thunderbird's native GPG support does not yet support smartcards.
+  # The official upstream recommendation is to configure fall back to gnupg
+  # using the Thunderbird config `mail.openpgp.allow_external_gnupg`
+  # and GPG keys set up; instructions with pictures at:
+  # https://anweshadas.in/how-to-use-yubikey-or-any-gpg-smartcard-in-thunderbird-78/
+  # For that to work out of the box, it requires `gnupg` on PATH and
+  # `gpgme` in `LD_LIBRARY_PATH`; we do this below.
+  buildCommand = old.buildCommand + ''
+    wrapProgram $out/bin/thunderbird \
+      --prefix LD_LIBRARY_PATH ':' "${lib.makeLibraryPath [ gpgme ]}" \
+      --prefix PATH ':' "${lib.makeBinPath [ gnupg ]}"
+  '';
+})