status-react/default.nix

52 lines
1.5 KiB
Nix
Raw Normal View History

let
pkgs = import ((import <nixpkgs> { }).fetchFromGitHub {
owner = "status-im";
repo = "nixpkgs";
rev = "15623aac6e8cbfa24d4268195bc8eda7303ea2ff";
sha256 = "0crjmspk65rbpkl3kqcj7433355i9fy530lhc48g2cz75xjk4sxh";
}) { config = { }; };
in with pkgs;
let
_stdenv = stdenvNoCC; # TODO: Try to use stdenv for Darwin
statusDesktop = callPackage ./scripts/lib/setup/nix/desktop { stdenv = _stdenv; };
2019-03-03 00:34:06 +00:00
statusMobile = callPackage ./scripts/lib/setup/nix/mobile { stdenv = _stdenv; };
nodeInputs = import ./scripts/lib/setup/nix/global-node-packages/output {
# The remaining dependencies come from Nixpkgs
inherit pkgs;
inherit nodejs;
};
nodePkgs = [
nodejs
python27 # for e.g. gyp
yarn
] ++ (map (x: nodeInputs."${x}") (builtins.attrNames nodeInputs));
in _stdenv.mkDerivation rec {
name = "env";
env = buildEnv { name = name; paths = buildInputs; };
buildInputs = with _stdenv; [
clojure
curl
jq
leiningen
lsof # used in scripts/start-react-native.sh
maven
ncurses
ps # used in scripts/start-react-native.sh
statusDesktop.buildInputs
2019-03-03 00:34:06 +00:00
statusMobile.buildInputs
watchman
unzip
wget
] ++ nodePkgs
++ lib.optional isDarwin cocoapods
++ lib.optional isLinux gcc7;
shellHook = ''
${statusDesktop.shellHook}
2019-03-03 00:34:06 +00:00
${statusMobile.shellHook}
2019-03-03 00:34:06 +00:00
[ -d "$ANDROID_SDK_ROOT" ] || ./scripts/setup # we assume that if the Android SDK dir does not exist, make setup needs to be run
'';
2019-03-03 00:34:06 +00:00
}