diff --git a/derivation.nix b/derivation.nix index d1c95eff1b..9a60163ffd 100644 --- a/derivation.nix +++ b/derivation.nix @@ -8,8 +8,8 @@ with pkgs; platform = callPackage ./nix/platform.nix { inherit target-os; }; # TODO: Try to use stdenv for iOS. The problem is with building iOS as the build is trying to pass parameters to Apple's ld that are meant for GNU's ld (e.g. -dynamiclib) _stdenv = stdenvNoCC; - statusDesktop = callPackage ./nix/desktop { inherit target-os; stdenv = _stdenv; }; - statusMobile = callPackage ./nix/mobile { inherit target-os config; stdenv = _stdenv; }; + statusDesktop = callPackage ./nix/desktop { inherit target-os status-go; stdenv = _stdenv; }; + statusMobile = callPackage ./nix/mobile { inherit target-os config status-go; stdenv = _stdenv; }; status-go = callPackage ./nix/status-go { inherit target-os; inherit (xcodeenv) composeXcodeWrapper; inherit (statusMobile) xcodewrapperArgs; androidPkgs = statusMobile.androidComposition; }; nodejs' = nodejs-10_x; yarn' = yarn.override { nodejs = nodejs'; }; @@ -22,7 +22,7 @@ with pkgs; nodejs' python27 # for e.g. gyp yarn' - ] ++ (map (x: nodeInputs."${x}") (builtins.attrNames nodeInputs)); + ] ++ (builtins.attrValues nodeInputs); in _stdenv.mkDerivation rec { name = "status-react-build-env"; @@ -32,15 +32,13 @@ with pkgs; leiningen maven watchman - ] ++ status-go.packages - ++ nodePkgBuildInputs + ] ++ nodePkgBuildInputs ++ lib.optional isDarwin cocoapods ++ lib.optional (isDarwin && !platform.targetIOS) clang ++ lib.optional (!isDarwin) gcc7 ++ lib.optionals platform.targetDesktop statusDesktop.buildInputs ++ lib.optionals platform.targetMobile statusMobile.buildInputs; shellHook = - status-go.shellHook + lib.optionalString platform.targetDesktop statusDesktop.shellHook + lib.optionalString platform.targetMobile statusMobile.shellHook; } diff --git a/nix/desktop/default.nix b/nix/desktop/default.nix index a7e71798cc..f6a129acbd 100644 --- a/nix/desktop/default.nix +++ b/nix/desktop/default.nix @@ -1,12 +1,12 @@ -{ stdenv, pkgs, target-os }: +{ stdenv, pkgs, target-os, status-go }: with pkgs; with stdenv; let platform = callPackage ../platform.nix { inherit target-os; }; - linuxPlatform = callPackage ./linux { }; - darwinPlatform = callPackage ./macos { }; + linuxPlatform = callPackage ./linux { inherit status-go; }; + darwinPlatform = callPackage ./macos { inherit status-go; }; windowsPlatform = callPackage ./windows { }; snoreNotifySources = callPackage ./cmake/snorenotify { }; qtkeychainSources = callPackage ./cmake/qtkeychain { }; diff --git a/nix/desktop/linux/default.nix b/nix/desktop/linux/default.nix index c575e319b8..7cfbab05d4 100644 --- a/nix/desktop/linux/default.nix +++ b/nix/desktop/linux/default.nix @@ -1,4 +1,4 @@ -{ stdenv, pkgs }: +{ stdenv, pkgs, status-go }: with pkgs; with stdenv; @@ -11,7 +11,14 @@ let linuxdeployqt = callPackage ./linuxdeployqt { inherit appimagekit; }; in { - buildInputs = [ appimagekit linuxdeployqt patchelf baseImage ]; + buildInputs = [ + appimagekit + linuxdeployqt + patchelf + baseImage + ] ++ status-go.packages; - inherit (baseImage) shellHook; + shellHook = + baseImage.shellHook + + status-go.shellHook; } diff --git a/nix/desktop/macos/default.nix b/nix/desktop/macos/default.nix index 05d3f3bb2a..7739fa3618 100644 --- a/nix/desktop/macos/default.nix +++ b/nix/desktop/macos/default.nix @@ -1,4 +1,4 @@ -{ stdenv, pkgs }: +{ stdenv, pkgs, status-go }: with pkgs; with stdenv; @@ -11,11 +11,14 @@ let in { - buildInputs = [ baseImage ] ++ - [ AppKit Cocoa darwin.cf-private Foundation OpenGL ]; + buildInputs = [ + baseImage status-go.packages + AppKit Cocoa darwin.cf-private Foundation OpenGL + ]; - shellHook = '' - ${baseImage.shellHook} - export NIX_TARGET_LDFLAGS="-F${CoreFoundation}/Library/Frameworks -framework CoreFoundation $NIX_TARGET_LDFLAGS" - ''; + shellHook = + baseImage.shellHook + + status-go.shellHook + '' + export NIX_TARGET_LDFLAGS="-F${CoreFoundation}/Library/Frameworks -framework CoreFoundation $NIX_TARGET_LDFLAGS" + ''; } diff --git a/nix/mobile/default.nix b/nix/mobile/default.nix index c3310f979a..4979ea6f69 100644 --- a/nix/mobile/default.nix +++ b/nix/mobile/default.nix @@ -1,4 +1,4 @@ -{ config, stdenv, pkgs, target-os ? "all" }: +{ config, stdenv, pkgs, target-os ? "all", status-go }: with pkgs; with stdenv; @@ -18,8 +18,10 @@ in inherit xcodewrapperArgs; buildInputs = - lib.optional platform.targetAndroid android.buildInputs ++ + status-go.packages ++ + lib.optionals platform.targetAndroid android.buildInputs ++ lib.optional (platform.targetIOS && isDarwin) xcodeWrapper; shellHook = + status-go.shellHook + lib.optionalString platform.targetAndroid android.shellHook; }