From dc73d65a1472d79c88799302be24d1782ccb5a3b Mon Sep 17 00:00:00 2001 From: Friedrich Altheide Date: Wed, 8 Jan 2025 15:11:12 +0100 Subject: [PATCH] thunderbird: add languagePacks option --- nixos/modules/programs/thunderbird.nix | 124 +++++++++++++++++++++++++ 1 file changed, 124 insertions(+) diff --git a/nixos/modules/programs/thunderbird.nix b/nixos/modules/programs/thunderbird.nix index b15c1df6094393..5b6d7bbecb784f 100644 --- a/nixos/modules/programs/thunderbird.nix +++ b/nixos/modules/programs/thunderbird.nix @@ -65,6 +65,121 @@ in - `"clear"`: Value has no effect. Resets to factory defaults on each startup. ''; }; + + languagePacks = lib.mkOption { + # Available languages can be found in https://releases.mozilla.org/pub/thunderbird/releases/${cfg.package.version}/linux-x86_64/xpi/ + type = lib.types.listOf ( + lib.types.enum ([ + "ach" + "af" + "an" + "ar" + "ast" + "az" + "be" + "bg" + "bn" + "br" + "bs" + "ca-valencia" + "ca" + "cak" + "cs" + "cy" + "da" + "de" + "dsb" + "el" + "en-CA" + "en-GB" + "en-US" + "eo" + "es-AR" + "es-CL" + "es-ES" + "es-MX" + "et" + "eu" + "fa" + "ff" + "fi" + "fr" + "fur" + "fy-NL" + "ga-IE" + "gd" + "gl" + "gn" + "gu-IN" + "he" + "hi-IN" + "hr" + "hsb" + "hu" + "hy-AM" + "ia" + "id" + "is" + "it" + "ja" + "ka" + "kab" + "kk" + "km" + "kn" + "ko" + "lij" + "lt" + "lv" + "mk" + "mr" + "ms" + "my" + "nb-NO" + "ne-NP" + "nl" + "nn-NO" + "oc" + "pa-IN" + "pl" + "pt-BR" + "pt-PT" + "rm" + "ro" + "ru" + "sat" + "sc" + "sco" + "si" + "sk" + "skr" + "sl" + "son" + "sq" + "sr" + "sv-SE" + "szl" + "ta" + "te" + "tg" + "th" + "tl" + "tr" + "trs" + "uk" + "ur" + "uz" + "vi" + "xh" + "zh-CN" + "zh-TW" + ]) + ); + default = [ ]; + description = '' + The language packs to install. + ''; + }; }; config = lib.mkIf cfg.enable { @@ -82,6 +197,15 @@ in Value = value; Status = cfg.preferencesStatus; }) cfg.preferences; + ExtensionSettings = builtins.listToAttrs ( + builtins.map ( + lang: + lib.attrsets.nameValuePair "langpack-${lang}@thunderbird.mozilla.org" { + installation_mode = "normal_installed"; + install_url = "https://releases.mozilla.org/pub/thunderbird/releases/${cfg.package.version}/linux-x86_64/xpi/${lang}.xpi"; + } + ) cfg.languagePacks + ); }; };