Skip to content

Commit

Permalink
add devshell to run firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
Mic92 committed Jan 3, 2024
1 parent d7cfc33 commit 242055c
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` |
Expand Down
1 change: 1 addition & 0 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{ pkgs ? import <nixpkgs> {} }: {
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; };
Expand Down
32 changes: 32 additions & 0 deletions envs/firefox/shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{ pkgs ? import <nixpkgs> { }
, 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;
}

0 comments on commit 242055c

Please sign in to comment.