nix: Remove need to pass default values in `--arg config`
Signed-off-by: Pedro Pombeiro <pombeirp@users.noreply.github.com>
This commit is contained in:
parent
e38e9f1072
commit
af7341447c
|
@ -1,5 +1,5 @@
|
||||||
# target-os = [ 'windows' 'linux' 'macos' 'darwin' 'android' 'ios' 'all' ]
|
# target-os = [ 'windows' 'linux' 'macos' 'darwin' 'android' 'ios' 'all' ]
|
||||||
{ config ? { android_sdk.accept_license = true; },
|
{ config ? { },
|
||||||
nixpkgs-bootstrap ? import ./nix/nixpkgs-bootstrap.nix { inherit config; },
|
nixpkgs-bootstrap ? import ./nix/nixpkgs-bootstrap.nix { inherit config; },
|
||||||
pkgs ? nixpkgs-bootstrap.pkgs,
|
pkgs ? nixpkgs-bootstrap.pkgs,
|
||||||
stdenv ? pkgs.stdenv,
|
stdenv ? pkgs.stdenv,
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
# This file controls the pinned version of nixpkgs we use for our Nix environment
|
# This file controls the pinned version of nixpkgs we use for our Nix environment
|
||||||
{ config ? { android_sdk.accept_license = true; },
|
let
|
||||||
pkgs ? (import ((import <nixpkgs> { }).fetchFromGitHub {
|
inherit (import <nixpkgs> { }) fetchFromGitHub;
|
||||||
|
defaultConfig = { android_sdk.accept_license = true; };
|
||||||
|
nixpkgsSrc = {
|
||||||
name = "nixpkgs-source";
|
name = "nixpkgs-source";
|
||||||
owner = "status-im";
|
owner = "status-im";
|
||||||
repo = "nixpkgs";
|
repo = "nixpkgs";
|
||||||
|
@ -9,8 +11,15 @@
|
||||||
# To get the compressed Nix sha256, use:
|
# To get the compressed Nix sha256, use:
|
||||||
# nix-prefetch-url --unpack https://github.com/${ORG}/nixpkgs/archive/${REV}.tar.gz
|
# nix-prefetch-url --unpack https://github.com/${ORG}/nixpkgs/archive/${REV}.tar.gz
|
||||||
# The last line will be the hash.
|
# The last line will be the hash.
|
||||||
})) { inherit config; } }:
|
};
|
||||||
|
|
||||||
{
|
in {
|
||||||
inherit pkgs config;
|
config ? { },
|
||||||
}
|
config' ? defaultConfig // config,
|
||||||
|
pkgs ? (import (fetchFromGitHub nixpkgsSrc)) { config = config'; }
|
||||||
|
}:
|
||||||
|
|
||||||
|
{
|
||||||
|
inherit pkgs;
|
||||||
|
config = config';
|
||||||
|
}
|
||||||
|
|
|
@ -52,7 +52,7 @@ if [[ "$TARGET_OS" =~ (linux|windows|darwin|macos) ]]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "${STATUS_GO_SRC_OVERRIDE}" ]; then
|
if [ -n "${STATUS_GO_SRC_OVERRIDE}" ]; then
|
||||||
shellArgs+=("--arg config {android_sdk.accept_license=true;status_go.src_override=\"${STATUS_GO_SRC_OVERRIDE}\";}")
|
shellArgs+=("--arg config {status_go.src_override=\"${STATUS_GO_SRC_OVERRIDE}\";}")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# if _NIX_ATTR is specified we shouldn't use shell.nix, the path will be different
|
# if _NIX_ATTR is specified we shouldn't use shell.nix, the path will be different
|
||||||
|
|
|
@ -7,7 +7,7 @@ source "$_current_dir/lib/setup/path-support.sh"
|
||||||
source_lib "platform.sh"
|
source_lib "platform.sh"
|
||||||
|
|
||||||
nixOpts=(
|
nixOpts=(
|
||||||
"--arg config {android_sdk.accept_license=true;status_go.src_override=\"${STATUS_GO_SRC_OVERRIDE}\";}"
|
"--arg config {status_go.src_override=\"${STATUS_GO_SRC_OVERRIDE}\";}"
|
||||||
"--arg env {BUILD_ENV=\"${BUILD_ENV}\";ANDROID_ABI_SPLIT=\"${ANDROID_ABI_SPLIT}\";ANDROID_ABI_INCLUDE=\"${ANDROID_ABI_INCLUDE}\";}"
|
"--arg env {BUILD_ENV=\"${BUILD_ENV}\";ANDROID_ABI_SPLIT=\"${ANDROID_ABI_SPLIT}\";ANDROID_ABI_INCLUDE=\"${ANDROID_ABI_INCLUDE}\";}"
|
||||||
"--argstr build-type ${BUILD_TYPE}"
|
"--argstr build-type ${BUILD_TYPE}"
|
||||||
"--argstr build-number ${BUILD_NUMBER}"
|
"--argstr build-number ${BUILD_NUMBER}"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ config ? { android_sdk.accept_license = true; },
|
{ config ? { },
|
||||||
nixpkgs-bootstrap ? import ./nix/nixpkgs-bootstrap.nix { inherit config; },
|
nixpkgs-bootstrap ? import ./nix/nixpkgs-bootstrap.nix { inherit config; },
|
||||||
pkgs ? nixpkgs-bootstrap.pkgs,
|
pkgs ? nixpkgs-bootstrap.pkgs,
|
||||||
target-os ? "none" }:
|
target-os ? "none" }:
|
||||||
|
|
Loading…
Reference in New Issue