Clean up some nix files

This commit is contained in:
Pedro Pombeiro 2019-07-04 16:49:21 +02:00
parent 8d8ef4d263
commit 48c7f928cd
No known key found for this signature in database
GPG Key ID: C4A24185B2AA48A1
5 changed files with 22 additions and 22 deletions

View File

@ -8,7 +8,7 @@ def shell(Map opts = [:], String cmd) {
def defaults = [
pure: true,
args: ['target-os': env.TARGET_OS],
keep: ['LOCALE_ARCHIVE_2_27'],
keep: ['LOCALE_ARCHIVE_2_27', 'IN_CI_ENVIRONMENT'],
]
/* merge defaults with received opts */
opts = defaults + opts
@ -22,6 +22,7 @@ def shell(Map opts = [:], String cmd) {
set +x
. ~/.nix-profile/etc/profile.d/nix.sh
set -x
IN_CI_ENVIRONMENT=1 \\
nix-shell \\
${isPure ? "--pure" : ""} \\
${keepFlags.join(" ")} \\

View File

@ -6,25 +6,25 @@
let
platform = pkgs.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' = pkgs.stdenvNoCC;
stdenv = pkgs.stdenvNoCC;
gradle = pkgs.gradle_4_10;
go = pkgs.go_1_11;
buildGoPackage = pkgs.buildGoPackage.override { inherit go; };
statusDesktop = pkgs.callPackage ./nix/desktop { inherit target-os status-go pkgs go; inherit (pkgs) darwin; stdenv = stdenv'; nodejs = nodejs'; };
statusMobile = pkgs.callPackage ./nix/mobile { inherit target-os config pkgs status-go gradle; inherit (pkgs.xcodeenv) composeXcodeWrapper; stdenv = stdenv'; nodejs = nodejs'; };
statusDesktop = pkgs.callPackage ./nix/desktop { inherit target-os stdenv status-go pkgs nodejs go; inherit (pkgs) darwin; };
statusMobile = pkgs.callPackage ./nix/mobile { inherit target-os config stdenv pkgs nodejs status-go gradle; inherit (pkgs.xcodeenv) composeXcodeWrapper; };
status-go = pkgs.callPackage ./nix/status-go { inherit target-os go buildGoPackage; inherit (pkgs.xcodeenv) composeXcodeWrapper; inherit (statusMobile) xcodewrapperArgs; androidPkgs = statusMobile.androidComposition; };
nodejs' = pkgs.nodejs-10_x;
yarn' = pkgs.yarn.override { nodejs = nodejs'; };
nodejs = pkgs.nodejs-10_x;
yarn = pkgs.yarn.override { inherit nodejs; };
nodePkgBuildInputs = [
nodejs'
nodejs
pkgs.python27 # for e.g. gyp
yarn'
yarn
];
selectedSources =
stdenv'.lib.optional platform.targetDesktop statusDesktop ++
stdenv'.lib.optional platform.targetMobile statusMobile;
stdenv.lib.optional platform.targetDesktop statusDesktop ++
stdenv.lib.optional platform.targetMobile statusMobile;
in with stdenv'; stdenv'.mkDerivation rec {
in with stdenv; mkDerivation rec {
name = "status-react-build-env";
buildInputs = with pkgs; [

View File

@ -20,7 +20,6 @@ let
buildMessage = "Building mobile library for ${targetConfig.name}";
# Build mobile libraries
# TODO: Manage to pass -s -w to -ldflags. Seems to only accept a single flag
buildPhase = ''
GOPATH=${gomobile.dev}:$GOPATH \
PATH=${lib.makeBinPath [ gomobile.bin ]}:$PATH \

View File

@ -50,6 +50,7 @@ let
currentHostConfig = if isDarwin then hostConfigs.darwin else hostConfigs.linux;
goBuildFlags = "-v";
# TODO: Manage to pass -s -w to -ldflags. Seems to only accept a single flag
goBuildLdFlags = "-ldflags=-s";
xcodeWrapper = composeXcodeWrapper xcodewrapperArgs;

View File

@ -1,24 +1,23 @@
{ nixpkgs-bootstrap ? import ./nix/nixpkgs-bootstrap.nix { },
pkgs ? nixpkgs-bootstrap.pkgs,
target-os ? "all" }:
with pkgs;
let
projectDeps = import ./default.nix { inherit target-os pkgs nixpkgs-bootstrap; inherit (nixpkgs-bootstrap) config; };
platform = callPackage ./nix/platform.nix { inherit target-os; };
useFastlanePkg = (platform.targetAndroid && !stdenv'.isDarwin);
platform = pkgs.callPackage ./nix/platform.nix { inherit target-os; };
useFastlanePkg = (platform.targetAndroid && !stdenv.isDarwin);
# 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;
mkShell' = mkShell.override { stdenv = stdenv'; };
fastlane' = callPackage ./fastlane {
stdenv = pkgs.stdenvNoCC;
mkShell = pkgs.mkShell.override { inherit stdenv; };
fastlane = pkgs.callPackage ./fastlane {
bundlerEnv = _: pkgs.bundlerEnv {
name = "fastlane-gems";
gemdir = ./fastlane;
};
};
in mkShell' {
buildInputs = [
in mkShell {
buildInputs = with pkgs; [
# utilities
bash
curl
@ -32,7 +31,7 @@ in mkShell' {
unzip
wget
] ++
(if useFastlanePkg then [ fastlane' ] else lib.optionals platform.targetMobile [ bundler ruby ]); # bundler/ruby used for fastlane on macOS
(if useFastlanePkg then [ fastlane ] else with pkgs; lib.optionals platform.targetMobile [ bundler ruby ]); # bundler/ruby used for fastlane on macOS
inputsFrom = [ projectDeps ];
TARGET_OS = target-os;
shellHook = ''
@ -42,7 +41,7 @@ in mkShell' {
export PATH=$STATUS_REACT_HOME/node_modules/.bin:$PATH
${projectDeps.shellHook}
${lib.optionalString useFastlanePkg fastlane'.shellHook}
${stdenv.lib.optionalString useFastlanePkg fastlane.shellHook}
if [ "$IN_NIX_SHELL" != 'pure' ] && [ ! -f $STATUS_REACT_HOME/.ran-setup ]; then
$STATUS_REACT_HOME/scripts/setup