{"id":13799393,"url":"https://github.com/mozilla/nixpkgs-mozilla","last_synced_at":"2025-05-15T06:04:25.200Z","repository":{"id":9230741,"uuid":"61329173","full_name":"mozilla/nixpkgs-mozilla","owner":"mozilla","description":"Mozilla overlay for Nixpkgs.","archived":false,"fork":false,"pushed_at":"2025-04-14T09:54:33.000Z","size":300,"stargazers_count":555,"open_issues_count":60,"forks_count":130,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-05-08T05:27:18.657Z","etag":null,"topics":["mozilla-firefox","nix-overlay","rustlang"],"latest_commit_sha":null,"homepage":"","language":"Nix","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mozilla.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-06-16T22:14:00.000Z","updated_at":"2025-05-05T17:21:20.000Z","dependencies_parsed_at":"2024-01-08T08:02:39.744Z","dependency_job_id":"d7195b0e-a8c4-4f11-a759-bdb41cf17d45","html_url":"https://github.com/mozilla/nixpkgs-mozilla","commit_stats":{"total_commits":251,"total_committers":67,"mean_commits":3.746268656716418,"dds":0.8207171314741035,"last_synced_commit":"9b11a87c0cc54e308fa83aac5b4ee1816d5418a2"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mozilla%2Fnixpkgs-mozilla","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mozilla%2Fnixpkgs-mozilla/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mozilla%2Fnixpkgs-mozilla/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mozilla%2Fnixpkgs-mozilla/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mozilla","download_url":"https://codeload.github.com/mozilla/nixpkgs-mozilla/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254283337,"owners_count":22045140,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mozilla-firefox","nix-overlay","rustlang"],"created_at":"2024-08-04T00:01:02.265Z","updated_at":"2025-05-15T06:04:25.174Z","avatar_url":"https://github.com/mozilla.png","language":"Nix","readme":"nixpkgs-mozilla\n===============\n\nGathering nix efforts in one repository.\n\n\nCurrent packages\n----------------\n\n- gecko (https://github.com/mozilla/gecko-dev)\n- firefox-bin variants including Nightly\n\nfirefox-bin variants\n--------------------\n\nNixpkgs already has definitions for `firefox\n\u003chttps://github.com/NixOS/nixpkgs/blob/246d2848ff657d56fcf2d8596709e8869ce8616a/pkgs/applications/networking/browsers/firefox/packages.nix\u003e`_,\nwhich is built from source, as well as `firefox-bin\n\u003chttps://github.com/NixOS/nixpkgs/blob/ba2fe3c9a626a8fb845c786383b8b23ad8355951/pkgs/applications/networking/browsers/firefox-bin/default.nix\u003e`_,\nwhich is the binary Firefox version built by Mozilla.\n\nThe ``firefox-overlay.nix`` in this repository adds definitions for\nsome other firefox-bin variants that Mozilla ships:\n``firefox-nightly-bin``, ``firefox-beta-bin``, and\n``firefox-esr-bin``. All are exposed under a ``latest`` attribute,\ne.g. ``latest.firefox-nightly-bin``.\n\nUnfortunately, these variants do not auto-update, and you may see some\nannoying pop-ups complaining about this.\n\nNote that all the ``-bin`` packages are \"unfree\" (because of the\nFirefox trademark, held by Mozilla), so you will need to set\n``nixpkgs.config.allowUnfree`` in order to use them. More info `here\n\u003chttps://wiki.nixos.org/wiki/FAQ#How_can_I_install_a_package_from_unstable_while_remaining_on_the_stable_channel?\u003e`_.\n\nRust overlay\n------------\n\n**NOTE:** Nix overlays only works on up-to-date versions of NixOS/nixpkgs, starting from 17.03.\n\nA nixpkgs overlay is provided to contain all of the latest rust releases.\n\nTo use the rust overlay run the ``./rust-overlay-install.sh`` command. It will\nlink the current ``./rust-overlay.nix`` into your ``~/.config/nixpkgs/overlays`` folder.\n\nOnce this is done, use ``nix-env -iA nixpkgs.latest.rustChannels.nightly.rust`` for\nexample. Replace the ``nixpkgs.`` prefix with ``nixos.`` on NixOS.\n\nUsing in nix expressions\n------------------------\n\nExample of using in ```shell.nix```:\n\n.. code:: nix\n\n let\n   moz_overlay = import (builtins.fetchTarball https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz);\n   nixpkgs = import \u003cnixpkgs\u003e { overlays = [ moz_overlay ]; };\n in\n   with nixpkgs;\n   stdenv.mkDerivation {\n     name = \"moz_overlay_shell\";\n     buildInputs = [\n       # to use the latest nightly:\n       nixpkgs.latest.rustChannels.nightly.rust\n       # to use a specific nighly:\n       (nixpkgs.rustChannelOf { date = \"2018-04-11\"; channel = \"nightly\"; }).rust\n       # to use the project's rust-toolchain file:\n       (nixpkgs.rustChannelOf { rustToolchain = ./rust-toolchain; }).rust\n     ];\n   }\n\nFlake usage\n-----------\nThis repository contains a minimal flake interface for the various\noverlays in this repository. To use it in your own flake, add it as\nan input to your ``flake.nix``:\n\n.. code:: nix\n {\n   inputs.nixpkgs.url = github:NixOS/nixpkgs;\n   inputs.nixpkgs-mozilla.url = github:mozilla/nixpkgs-mozilla;\n\n   outputs = { self, nixpkgs, nixpkgs-mozilla }: {\n     devShell.\"x86_64-linux\" = let\n       pkgs = import nixpkgs { system = \"x86_64-linux\"; overlays = [ nixpkgs-mozilla.overlay ]; };\n     in pkgs.mkShell {\n       buildInputs = [ pkgs.latest.rustChannels.nightly.rust ];\n     };\n   };\n  }\nThe available overlays are ``nixpkgs-mozilla.overlay`` for the\ndefault overlay containing everything, and\n``nixpkgs-mozilla.overlays.{lib, rust, rr, firefox, git-cinnabar}``\nrespectively. Depending on your use case, you might need to set the\n``--impure`` flag when invoking the ``nix`` command. This is because\nthis repository fetches resources from non-pinned URLs\nnon-reproducibly.\n\nFirefox Development Environment\n-------------------------------\n\nThis repository provides several tools to facilitate development on\nFirefox. Firefox is built on an engine called Gecko, which lends its\nname to some of the files and derivations in this repo.\n\nChecking out Firefox\n~~~~~~~~~~~~~~~~~~~~\n\nTo build Firefox from source, it is best to have a local checkout of\n``mozilla-central``. ``mozilla-central`` is hosted in Mercurial, but\nsome people prefer to access it using ``git`` and\n``git-cinnabar``. The tools in this repo support either using\nmercurial or git.\n\nThis repository provides a ``git-cinnabar-overlay.nix`` which defines\na ``git-cinnabar`` derivation. This overlay can be used to install\n``git-cinnabar``, either using ``nix-env`` or as part of a system-wide\n``configuration.nix``.\n\nBuilding Firefox\n~~~~~~~~~~~~~~~~\n\nThe ``firefox-overlay.nix`` provides an environment to build Firefox\nfrom its sources, once you have finished the checkout of\n``mozilla-central``. You can use ``nix-shell`` to enter this\nenvironment to launch ``mach`` commands to build Firefox and test your\nbuild.\n\nSome debugging tools are available in this environment as well, but\nother development tools (such as those used to submit changes for\nreview) are outside the scope of this environment.\n\nThe ``nix-shell`` environment is available in the\n``gecko.\u003carch\u003e.\u003ccc\u003e`` attribute of the ``release.nix`` file provided\nin this repository.\n\nThe ``\u003carch\u003e`` attribute is either ``x86_64-linux`` or ``i686-linux``. The first\none would create a native toolchain for compiling on x64, while the second one\nwould give a native toolchain for compiling on x86. Note that due to the size of\nthe compilation units on x86, the compilation might not be able to complete, but\nsome sub part of Gecko, such as SpiderMonkey would compile fine.\n\nThe ``\u003ccc\u003e`` attribute is either ``gcc`` or ``clang``, or any specific version\nof the compiler available in the ``compiler-overlay.nix`` file which is repeated\nin ``release.nix``. This compiler would only be used for compiling Gecko, and\nthe rest of the toolchain is compiled against the default ``stdenv`` of the\narchitecture.\n\nWhen first entering the ``nix-shell``, the toolchain will pull and build all\nthe dependencies necessary to build Gecko, this includes might take some time.\nThis work will not be necessary the second time, unless you use a different\ntoolchain or architecture.\n\n.. code:: sh\n\n  ~/$ cd mozilla-central\n  ~/mozilla-central$ nix-shell ../nixpkgs-mozilla/release.nix -A gecko.x86_64-linux.gcc --pure\n    ... pull the rust compiler\n    ... compile the toolchain\n  # First time only - initialize virtualenv\n  [~/mozilla-central] python ./mach create-mach-environment\n     ... create .mozbuild/_virtualenvs/mach\n  [~/mozilla-central] python ./mach build\n    ... build firefox desktop\n  [~/mozilla-central] python ./mach run\n    ... run firefox\n\nWhen entering the ``nix-shell``, the ``MOZCONFIG`` environment variable is set\nto a local file, named ``.mozconfig.nix-shell``, created each time you enter the\n``nix-shell``. You can create your own ``.mozconfig`` file which extends the\ndefault one, with your own options.\n\n.. code:: sh\n\n  ~/mozilla-central$ nix-shell ../nixpkgs-mozilla/release.nix -A gecko.x86_64-linux.gcc --pure\n  [~/mozilla-central] cat .mozconfig\n  # Import current nix-shell config.\n  . .mozconfig.nix-shell\n\n  ac_add_options --enable-js-shell\n  ac_add_options --disable-tests\n  [~/mozilla-central] export MOZCONFIG=\"$(pwd)/.mozconfig\"\n  [~/mozilla-central] python ./mach build\n\nTo avoid repeating yourself, you can also rely on the ``NIX_SHELL_HOOK``\nenvironment variable, to reset the ``MOZCONFIG`` environment variable for you.\n\n.. code:: sh\n\n  ~/mozilla-central$ export NIX_SHELL_HOOK=\"export MOZCONFIG=$(pwd)/.mozconfig;\"\n  ~/mozilla-central$ nix-shell ../nixpkgs-mozilla/release.nix -A gecko.x86_64-linux.gcc --pure\n  [~/mozilla-central] python ./mach build\n\nSubmitting Firefox patches\n~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nFirefox development happens in `Mozilla Phabricator\n\u003chttps://phabricator.services.mozilla.com/\u003e`_. Mozilla Phabricator\ndocs are `here\n\u003chttps://moz-conduit.readthedocs.io/en/latest/phabricator-user.html\u003e`_.\n\nTo get your commits into Phabricator, some options include:\n\n- Arcanist, the upstream tool for interacting with\n  Phabricator. Arcanist is packaged in nixpkgs already; you can find\n  it in `nixos.arcanist`. Unfortunately, as of this writing, upstream\n  Arcanist does not support ``git-cinnabar`` (according to `the\n  \"Setting up Arcanist\"\n  \u003chttps://moz-conduit.readthedocs.io/en/latest/phabricator-user.html#setting-up-arcanist\u003e`_\n  documentation). `Mozilla maintains a fork of Arcanist\n  \u003chttps://github.com/mozilla-conduit/arcanist\u003e`_ but it isn't yet\n  packaged. (PRs welcome.)\n\n- `moz-phab \u003chttps://github.com/mozilla-conduit/review\u003e`_, an in-house\n  CLI for Phabricator. It's available in nix packages (unstable channel).\n\n- `phlay \u003chttps://github.com/mystor/phlay\u003e`_, a small Python script\n  that speaks to the Phabricator API directly. This repository ships a\n  ``phlay-overlay.nix`` that you can use to make ``phlay`` available\n  in a nix-shell or nix-env.\n\nNote: although the ``nix-shell`` from the previous section may have\nall the tools you would normally use to do Firefox development, it\nisn't recommended that you use that shell for anything besides tasks\nthat involve running ``mach``. Other development tasks such as\ncommitting code and submitting patches to code review are best handled\nin a separate nix-shell.\n\nTODO\n----\n\n- setup hydra to have binary channels\n\n- make sure pinned revisions get updated automatically (if build passes we\n  should update revisions in default.nix)\n\n- pin to specific (working) nixpkgs revision (as we do for other sources)\n\n- can we make this work on darwin as well?\n\n- assign maintainers for our packages that will montior that it \"always\" builds\n\n- hook it with vulnix report to monitor CVEs (once vulnix is ready, it must be\n  ready soon :P)\n","funding_links":[],"categories":["Nix","Overlays","Programming Languages"],"sub_categories":["Rust"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmozilla%2Fnixpkgs-mozilla","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmozilla%2Fnixpkgs-mozilla","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmozilla%2Fnixpkgs-mozilla/lists"}