diff --git a/modules/programs/firefox/mkFirefoxModule.nix b/modules/programs/firefox/mkFirefoxModule.nix index 8007a9a49..33c022890 100644 --- a/modules/programs/firefox/mkFirefoxModule.nix +++ b/modules/programs/firefox/mkFirefoxModule.nix @@ -24,6 +24,7 @@ let mkIf mkMerge mkOption + mkOptionDefault optionalString optional setAttrByPath @@ -235,6 +236,12 @@ in ''; }; + release = mkOption { + internal = true; + type = types.str; + description = "Upstream release version used to fetch from `releases.mozilla.org`."; + }; + languagePacks = mkOption { type = types.listOf types.str; default = [ ]; @@ -242,7 +249,9 @@ in The language packs to install. Available language codes can be found on the releases page: `https://releases.mozilla.org/pub/firefox/releases/''${version}/linux-x86_64/xpi/`, - replacing `''${version}` with the version of ${appName} you have. + replacing `''${version}` with the version of ${appName} you have. If + the version string of your Firefox derivative diverts from the upstream + version, try setting the `release` option. ''; example = [ "en-GB" @@ -952,6 +961,7 @@ in } // setAttrByPath modulePath { finalPackage = wrapPackage cfg.package; + release = mkOptionDefault (builtins.head (lib.splitString "-" cfg.package.version)); policies = { ExtensionSettings = lib.mkIf (cfg.languagePacks != [ ]) ( @@ -960,7 +970,7 @@ in lang: lib.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"; + install_url = "https://releases.mozilla.org/pub/firefox/releases/${cfg.release}/linux-x86_64/xpi/${lang}.xpi"; } ) cfg.languagePacks )