Giter Site home page Giter Site logo

nixpkgs-mozilla's Introduction

nixpkgs-mozilla

Gathering nix efforts in one repository.

Current packages

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 ./rust-overlay-install.sh 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`:

let
  moz_overlay = import (builtins.fetchTarball https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz);
  nixpkgs = import <nixpkgs> { overlays = [ moz_overlay ]; };
in
  with nixpkgs;
  stdenv.mkDerivation {
    name = "moz_overlay_shell";
    buildInputs = [
      nixpkgs.latest.rustChannels.nightly.rust
      ];
  }

Or to retrieve a specific nightly version:

let
  moz_overlay = import (builtins.fetchTarball https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz);
  nixpkgs = import <nixpkgs> { overlays = [ moz_overlay ]; };
in
  with nixpkgs;
  stdenv.mkDerivation {
    name = "moz_overlay_shell";
    buildInputs = [
      (nixpkgs.rustChannelOf { date = "2018-04-11"; channel = "nightly"; }).rust
      ];
  }

Gecko Development Environment

The firefox-overlay.nix provides a development environment to build Firefox from its sources, also known as Gecko.

To build Gecko from its sources, it is best to have a local checkout of Gecko, and to build it with a nix-shell. You can checkout Gecko, either using mercurial, or git.

Once you have finished the checkout gecko, you should enter the nix-shell using 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 enterring 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 enterring 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 your-self, 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

TODO

  • 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)
  • servo can currently only be used with nix-shell. its build system tries to dowload quite few things (it is doing pip install and cargo install). it should be possible to replace that with nix
  • 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)

nixpkgs-mozilla's People

Contributors

adisbladis avatar anderspapitto avatar bburdette avatar bhipple avatar bkchr avatar dtzwill avatar dywedir avatar ekleog avatar garbas avatar glasserc avatar havvy avatar hedning avatar johnae avatar kolloch avatar lheckemann avatar mic92 avatar mythmon avatar nbp avatar rbartlensky avatar rexim avatar rimmington avatar seppeljordan avatar slabity avatar steveej avatar tilpner avatar veprbl avatar xzfc avatar zimbatm avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.