diff --git a/README.md b/README.md index 1903678..40781ca 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ What environments should **not** include: | [Arduino](envs/arduino) | `arduino` | | [cc2538-bsl](envs/cc2538-bsl) | `cc2538-bsl` | | [Jruby](envs/jruby) | `jruby` | +| [Firefox](envs/firefox) | `firefox` | | [Github Pages](envs/github-pages) | `github-pages` | | [Homeassistant](envs/home-assistant) | `home-assistant` | | [Nannou](envs/nannou) | `nannou` | diff --git a/default.nix b/default.nix index 9fc9b1f..c13905a 100644 --- a/default.nix +++ b/default.nix @@ -1,6 +1,7 @@ { pkgs ? import {} }: { arduino = import ./envs/arduino/shell.nix { inherit pkgs; }; cc2538-bsl = import ./envs/cc2538-bsl/shell.nix { inherit pkgs; }; + firefox = import ./envs/firefox/shell.nix { inherit pkgs; }; github-pages = import ./envs/github-pages/shell.nix { inherit pkgs; }; home-assistant = import ./envs/home-assistant/shell.nix { inherit pkgs; }; nannou = import ./envs/nannou/shell.nix { inherit pkgs; }; diff --git a/envs/firefox/shell.nix b/envs/firefox/shell.nix new file mode 100644 index 0000000..8c0abc6 --- /dev/null +++ b/envs/firefox/shell.nix @@ -0,0 +1,32 @@ +{ pkgs ? import { } +, extraPkgs ? [ ] +}: +let + # Target the LLVM version that rustc is built with for LTO. + llvmPackages0 = pkgs.rustc.llvmPackages; + + # Force the use of lld and other llvm tools for LTO + llvmPackages = llvmPackages0.override { + bootBintoolsNoLibc = null; + bootBintools = null; + }; + + # LTO requires LLVM bintools including ld.lld and llvm-ar. + buildStdenv = pkgs.overrideCC llvmPackages.stdenv (llvmPackages.stdenv.cc.override { + bintools = pkgs.buildPackages.rustc.llvmPackages.bintools; + }); +in +# Disclaimer: This currently also requies nix-ld (https://github.com/Mic92/nix-ld) to run binaries provided by mozilla. +buildStdenv.mkDerivation { + name = "env"; + nativeBuildInputs = [ + pkgs.bashInteractive + pkgs.mercurial + pkgs.rustc + pkgs.cargo + pkgs.unzip + pkgs.m4 + pkgs.pkg-config + ] ++ pkgs.lib.optional (!pkgs.stdenv.isDarwin) pkgs.libnotify + ++ extraPkgs; +}