Skip to content

Commit

Permalink
thunderbird: add languagePacks option
Browse files Browse the repository at this point in the history
  • Loading branch information
FriedrichAltheide committed Jan 8, 2025
1 parent a797d90 commit dc73d65
Showing 1 changed file with 124 additions and 0 deletions.
124 changes: 124 additions & 0 deletions nixos/modules/programs/thunderbird.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
);
};
};

Expand Down

0 comments on commit dc73d65

Please sign in to comment.