1
0
mirror of https://github.com/nix-community/home-manager synced 2024-06-01 04:23:34 +02:00

firefox: add languagePacks option

Port the programs.firefox.languagePacks option from NixOS
This commit is contained in:
Cezary Drożak 2024-03-27 19:18:49 +01:00
parent 1c43dcfac4
commit e9cbe7e1fe

View File

@ -206,7 +206,14 @@ let
else if versionAtLeast config.home.stateVersion "19.09" then
package.override (old: {
cfg = old.cfg or { } // fcfg;
extraPolicies = (old.extraPolicies or { }) // cfg.policies;
extraPolicies = (old.extraPolicies or { }) // {
ExtensionSettings = listToAttrs (map (lang:
nameValuePair "langpack-${lang}@firefox.mozilla.org" {
installation_mode = "normal_installed";
install_url =
"https://releases.mozilla.org/pub/firefox/releases/${cfg.package.version}/linux-x86_64/xpi/${lang}.xpi";
}) cfg.languagePacks);
} // cfg.policies;
})
else
(pkgs.wrapFirefox.override { config = bcfg; }) package { };
@ -262,6 +269,111 @@ in {
'';
};
languagePacks = mkOption {
type = types.listOf (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"
"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"
"sco"
"si"
"sk"
"sl"
"son"
"sq"
"sr"
"sv-SE"
"szl"
"ta"
"te"
"th"
"tl"
"tr"
"trs"
"uk"
"ur"
"uz"
"vi"
"xh"
"zh-CN"
"zh-TW"
]));
default = [ ];
description = "The language packs to install.";
};
nativeMessagingHosts = mkOption {
type = types.listOf types.package;
default = [ ];