Clean up some nix files
This commit is contained in:
parent
8d8ef4d263
commit
48c7f928cd
|
@ -8,7 +8,7 @@ def shell(Map opts = [:], String cmd) {
|
||||||
def defaults = [
|
def defaults = [
|
||||||
pure: true,
|
pure: true,
|
||||||
args: ['target-os': env.TARGET_OS],
|
args: ['target-os': env.TARGET_OS],
|
||||||
keep: ['LOCALE_ARCHIVE_2_27'],
|
keep: ['LOCALE_ARCHIVE_2_27', 'IN_CI_ENVIRONMENT'],
|
||||||
]
|
]
|
||||||
/* merge defaults with received opts */
|
/* merge defaults with received opts */
|
||||||
opts = defaults + opts
|
opts = defaults + opts
|
||||||
|
@ -22,6 +22,7 @@ def shell(Map opts = [:], String cmd) {
|
||||||
set +x
|
set +x
|
||||||
. ~/.nix-profile/etc/profile.d/nix.sh
|
. ~/.nix-profile/etc/profile.d/nix.sh
|
||||||
set -x
|
set -x
|
||||||
|
IN_CI_ENVIRONMENT=1 \\
|
||||||
nix-shell \\
|
nix-shell \\
|
||||||
${isPure ? "--pure" : ""} \\
|
${isPure ? "--pure" : ""} \\
|
||||||
${keepFlags.join(" ")} \\
|
${keepFlags.join(" ")} \\
|
||||||
|
|
|
@ -6,25 +6,25 @@
|
||||||
let
|
let
|
||||||
platform = pkgs.callPackage ./nix/platform.nix { inherit target-os; };
|
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)
|
# 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;
|
gradle = pkgs.gradle_4_10;
|
||||||
go = pkgs.go_1_11;
|
go = pkgs.go_1_11;
|
||||||
buildGoPackage = pkgs.buildGoPackage.override { inherit go; };
|
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'; };
|
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 pkgs status-go gradle; inherit (pkgs.xcodeenv) composeXcodeWrapper; stdenv = stdenv'; nodejs = nodejs'; };
|
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; };
|
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;
|
nodejs = pkgs.nodejs-10_x;
|
||||||
yarn' = pkgs.yarn.override { nodejs = nodejs'; };
|
yarn = pkgs.yarn.override { inherit nodejs; };
|
||||||
nodePkgBuildInputs = [
|
nodePkgBuildInputs = [
|
||||||
nodejs'
|
nodejs
|
||||||
pkgs.python27 # for e.g. gyp
|
pkgs.python27 # for e.g. gyp
|
||||||
yarn'
|
yarn
|
||||||
];
|
];
|
||||||
selectedSources =
|
selectedSources =
|
||||||
stdenv'.lib.optional platform.targetDesktop statusDesktop ++
|
stdenv.lib.optional platform.targetDesktop statusDesktop ++
|
||||||
stdenv'.lib.optional platform.targetMobile statusMobile;
|
stdenv.lib.optional platform.targetMobile statusMobile;
|
||||||
|
|
||||||
in with stdenv'; stdenv'.mkDerivation rec {
|
in with stdenv; mkDerivation rec {
|
||||||
name = "status-react-build-env";
|
name = "status-react-build-env";
|
||||||
|
|
||||||
buildInputs = with pkgs; [
|
buildInputs = with pkgs; [
|
||||||
|
|
|
@ -20,7 +20,6 @@ let
|
||||||
|
|
||||||
buildMessage = "Building mobile library for ${targetConfig.name}";
|
buildMessage = "Building mobile library for ${targetConfig.name}";
|
||||||
# Build mobile libraries
|
# Build mobile libraries
|
||||||
# TODO: Manage to pass -s -w to -ldflags. Seems to only accept a single flag
|
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
GOPATH=${gomobile.dev}:$GOPATH \
|
GOPATH=${gomobile.dev}:$GOPATH \
|
||||||
PATH=${lib.makeBinPath [ gomobile.bin ]}:$PATH \
|
PATH=${lib.makeBinPath [ gomobile.bin ]}:$PATH \
|
||||||
|
|
|
@ -50,6 +50,7 @@ let
|
||||||
currentHostConfig = if isDarwin then hostConfigs.darwin else hostConfigs.linux;
|
currentHostConfig = if isDarwin then hostConfigs.darwin else hostConfigs.linux;
|
||||||
|
|
||||||
goBuildFlags = "-v";
|
goBuildFlags = "-v";
|
||||||
|
# TODO: Manage to pass -s -w to -ldflags. Seems to only accept a single flag
|
||||||
goBuildLdFlags = "-ldflags=-s";
|
goBuildLdFlags = "-ldflags=-s";
|
||||||
|
|
||||||
xcodeWrapper = composeXcodeWrapper xcodewrapperArgs;
|
xcodeWrapper = composeXcodeWrapper xcodewrapperArgs;
|
||||||
|
|
19
shell.nix
19
shell.nix
|
@ -1,24 +1,23 @@
|
||||||
{ nixpkgs-bootstrap ? import ./nix/nixpkgs-bootstrap.nix { },
|
{ nixpkgs-bootstrap ? import ./nix/nixpkgs-bootstrap.nix { },
|
||||||
pkgs ? nixpkgs-bootstrap.pkgs,
|
pkgs ? nixpkgs-bootstrap.pkgs,
|
||||||
target-os ? "all" }:
|
target-os ? "all" }:
|
||||||
with pkgs;
|
|
||||||
|
|
||||||
let
|
let
|
||||||
projectDeps = import ./default.nix { inherit target-os pkgs nixpkgs-bootstrap; inherit (nixpkgs-bootstrap) config; };
|
projectDeps = import ./default.nix { inherit target-os pkgs nixpkgs-bootstrap; inherit (nixpkgs-bootstrap) config; };
|
||||||
platform = callPackage ./nix/platform.nix { inherit target-os; };
|
platform = pkgs.callPackage ./nix/platform.nix { inherit target-os; };
|
||||||
useFastlanePkg = (platform.targetAndroid && !stdenv'.isDarwin);
|
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)
|
# 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;
|
stdenv = pkgs.stdenvNoCC;
|
||||||
mkShell' = mkShell.override { stdenv = stdenv'; };
|
mkShell = pkgs.mkShell.override { inherit stdenv; };
|
||||||
fastlane' = callPackage ./fastlane {
|
fastlane = pkgs.callPackage ./fastlane {
|
||||||
bundlerEnv = _: pkgs.bundlerEnv {
|
bundlerEnv = _: pkgs.bundlerEnv {
|
||||||
name = "fastlane-gems";
|
name = "fastlane-gems";
|
||||||
gemdir = ./fastlane;
|
gemdir = ./fastlane;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
in mkShell' {
|
in mkShell {
|
||||||
buildInputs = [
|
buildInputs = with pkgs; [
|
||||||
# utilities
|
# utilities
|
||||||
bash
|
bash
|
||||||
curl
|
curl
|
||||||
|
@ -32,7 +31,7 @@ in mkShell' {
|
||||||
unzip
|
unzip
|
||||||
wget
|
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 ];
|
inputsFrom = [ projectDeps ];
|
||||||
TARGET_OS = target-os;
|
TARGET_OS = target-os;
|
||||||
shellHook = ''
|
shellHook = ''
|
||||||
|
@ -42,7 +41,7 @@ in mkShell' {
|
||||||
export PATH=$STATUS_REACT_HOME/node_modules/.bin:$PATH
|
export PATH=$STATUS_REACT_HOME/node_modules/.bin:$PATH
|
||||||
|
|
||||||
${projectDeps.shellHook}
|
${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
|
if [ "$IN_NIX_SHELL" != 'pure' ] && [ ! -f $STATUS_REACT_HOME/.ran-setup ]; then
|
||||||
$STATUS_REACT_HOME/scripts/setup
|
$STATUS_REACT_HOME/scripts/setup
|
||||||
|
|
Loading…
Reference in New Issue