Skip to content
mozilla related nixpkgs (extends nixos/nixpkgs repo)
Branch: master
Clone or download
Latest commit 200cf06 Jun 13, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib Fix #148 - Accept TOML list blindly. Jan 21, 2019
pkgs Add jsdoc using node2nix May 10, 2019
.gitignore create a travis build and set gecko build to be built Jul 19, 2016
.travis.yml typos in travis.yml Aug 7, 2016 Add Mozilla Code of Conduct file Apr 1, 2019
LICENSE Change license to MIT, fixes #17 Mar 27, 2017
README.rst Add another section about submitting Firefox patches Oct 17, 2018
compilers-overlay.nix Index newer version of clang compilers for release.nix script. Jan 25, 2019
default.nix Allow usage as package set instead of overlay Sep 6, 2018
deploy_rsa.enc adding ssh key to travis Aug 7, 2016
firefox-overlay.nix Add comment to explicit the location of the new KEY file of Firefox Mar 28, 2019
firefox.key Update firefox.key Jun 13, 2019
git-cinnabar-overlay.nix Add git-cinnabar 0.5.0b3 Aug 2, 2018
lib-overlay.nix Convert nixpkgs-mozilla repository into a valid Nixpkgs overlay, which Aug 16, 2017
overlays.nix remove servo: Sep 13, 2018
package-set.nix Allow usage as package set instead of overlay Sep 6, 2018
phlay-overlay.nix Add derivation for phlay Oct 16, 2018
pinned.nix remove servo: Sep 13, 2018
release.nix Gecko: Disable rr on ARM64 environments. Jan 25, 2019
rr-overlay.nix Add support for building rr natively on i686-linux. Apr 5, 2018 Fixes the overlay documentation Mar 16, 2017
rust-overlay.nix Fix #152 - Rust: Remove add-needed libstdc++ line. Jan 25, 2019
rust-src-overlay.nix Add a rust-src-overlay.nix which adds rust-src as an extension to all… Mar 13, 2018
update.nix update.nix: Allow user to skip prompt with dont_prompt parameter Jul 17, 2017
vidyo-overlay.nix Add Vidyo overlay. Aug 16, 2017



Gathering nix efforts in one repository.

Current packages

firefox-bin variants

Nixpkgs already has definitions for firefox, which is built from source, as well as firefox-bin, which is the binary Firefox version built by Mozilla.

The firefox-overlay.nix in this repository adds definitions for some other firefox-bin variants that Mozilla ships: firefox-nightly-bin, firefox-beta-bin, and firefox-esr-bin. All are exposed under a latest attribute, e.g. latest.firefox-nightly-bin.

Unfortunately, these variants do not auto-update, and you may see some annoying pop-ups complaining about this.

Note that all the -bin packages are "unfree" (because of the Firefox trademark, held by Mozilla), so you will need to set nixpkgs.config.allowUnfree in order to use them. More info here.

Rust overlay

NOTE: Nix overlays only works on up-to-date versions of NixOS/nixpkgs, starting from 17.03.

A nixpkgs overlay is provided to contains all of the latest rust releases.

To use the rust overlay run the ./ command. It will link the current ./rust-overlay.nix into your ~/.config/nixpkgs/overlays folder.

Once this is done, use nix-env -iA nixpkgs.latest.rustChannels.nightly.rust for example. Replace the nixpkgs. prefix with nixos. on NixOS.

Using in nix expressions

Example of using in `shell.nix`:

  moz_overlay = import (builtins.fetchTarball;
  nixpkgs = import <nixpkgs> { overlays = [ moz_overlay ]; };
  with nixpkgs;
  stdenv.mkDerivation {
    name = "moz_overlay_shell";
    buildInputs = [

Or to retrieve a specific nightly version:

  moz_overlay = import (builtins.fetchTarball;
  nixpkgs = import <nixpkgs> { overlays = [ moz_overlay ]; };
  with nixpkgs;
  stdenv.mkDerivation {
    name = "moz_overlay_shell";
    buildInputs = [
      (nixpkgs.rustChannelOf { date = "2018-04-11"; channel = "nightly"; }).rust

Firefox Development Environment

This repository provides several tools to facilitate development on Firefox. Firefox is built on an engine called Gecko, which lends its name to some of the files and derivations in this repo.

Checking out Firefox

To build Firefox from source, it is best to have a local checkout of mozilla-central. mozilla-central is hosted in Mercurial, but some people prefer to access it using git and git-cinnabar. The tools in this repo support either using mercurial or git.

This repository provides a git-cinnabar-overlay.nix which defines a git-cinnabar derivation. This overlay can be used to install git-cinnabar, either using nix-env or as part of a system-wide configuration.nix.

Building Firefox

The firefox-overlay.nix provides an environment to build Firefox from its sources, once you have finished the checkout of mozilla-central. You can use nix-shell to enter this environment to launch mach commands to build Firefox and test your build.

Some debugging tools are available in this environment as well, but other development tools (such as those used to submit changes for review) are outside the scope of this environment.

The nix-shell environment is available in the gecko.<arch>.<cc> attribute of the release.nix file provided in this repository.

The <arch> attribute is either x86_64-linux or i686-linux. The first one would create a native toolchain for compiling on x64, while the second one would give a native toolchain for compiling on x86. Note that due to the size of the compilation units on x86, the compilation might not be able to complete, but some sub part of Gecko, such as SpiderMonkey would compile fine.

The <cc> attribute is either gcc or clang, or any specific version of the compiler available in the compiler-overlay.nix file which is repeated in release.nix. This compiler would only be used for compiling Gecko, and the rest of the toolchain is compiled against the default stdenv of the architecture.

When first entering the nix-shell, the toolchain will pull and build all the dependencies necessary to build Gecko, this includes might take some time. This work will not be necessary the second time, unless you use a different toolchain or architecture.

~/$ cd mozilla-central
~/mozilla-central$ nix-shell ../nixpkgs-mozilla/release.nix -A gecko.x86_64-linux.gcc --pure
  ... pull the rust compiler
  ... compile the toolchain
[~/mozilla-central] python ./mach build
  ... build firefox desktop
[~/mozilla-central] python ./mach run
  ... run firefox

When entering the nix-shell, the MOZCONFIG environment variable is set to a local file, named .mozconfig.nix-shell, created each time you enter the nix-shell. You can create your own .mozconfig file which extends the default one, with your own options.

~/mozilla-central$ nix-shell ../nixpkgs-mozilla/release.nix -A gecko.x86_64-linux.gcc --pure
[~/mozilla-central] cat .mozconfig
# Import current nix-shell config.
. .mozconfig.nix-shell

ac_add_options --enable-js-shell
ac_add_options --disable-tests
[~/mozilla-central] export MOZCONFIG=$(pwd)/.mozconfig
[~/mozilla-central] python ./mach build

To avoid repeating yourself, you can also rely on the NIX_SHELL_HOOK environment variable, to reset the MOZCONFIG environment variable for you.

~/mozilla-central$ export NIX_SHELL_HOOK="export MOZCONFIG=$(pwd)/.mozconfig;"
~/mozilla-central$ nix-shell ../nixpkgs-mozilla/release.nix -A gecko.x86_64-linux.gcc --pure
[~/mozilla-central] python ./mach build

Submitting Firefox patches

Firefox development happens in Mozilla Phabricator. Mozilla Phabricator docs are here.

To get your commits into Phabricator, some options include:

  • Arcanist, the upstream tool for interacting with Phabricator. Arcanist is packaged in nixpkgs already; you can find it in nixos.arcanist. Unfortunately, as of this writing, upstream Arcanist does not support git-cinnabar (according to the "Setting up Arcanist" documentation). Mozilla maintains a fork of Arcanist but it isn't yet packaged. (PRs welcome.)
  • moz-phab, a small Python script that wraps Arcanist to try to handle commit series better than stock Arcanist. Because it wraps Arcanist, it suffers from the same problems that Arcanist does if you use git-cinnabar, and may work better if you use Mozilla's Arcanist fork. moz-phab isn't packaged yet. (PRs welcome.)
  • phlay, a small Python script that speaks to the Phabricator API directly. This repository ships a phlay-overlay.nix that you can use to make phlay available in a nix-shell or nix-env.

Note: although the nix-shell from the previous section may have all the tools you would normally use to do Firefox development, it isn't recommended that you use that shell for anything besides tasks that involve running mach. Other development tasks such as committing code and submitting patches to code review are best handled in a separate nix-shell.


  • setup hydra to have binary channels
  • make sure pinned revisions get updated automatically (if build passes we should update revisions in default.nix)
  • pin to specific (working) nixpkgs revision (as we do for other sources)
  • can we make this work on darwin as well?
  • assign maintainers for our packages that will montior that it "always" builds
  • hook it with vulnix report to monitor CVEs (once vulnix is ready, it must be ready soon :P)
You can’t perform that action at this time.