2019-04-03 13:06:42 +02:00
# target-os = [ 'windows' 'linux' 'macos' 'android' 'ios' 'all' ]
{ config ? { android_sdk . accept_license = true ; } ,
pkgs ? import ( ( import <nixpkgs> { } ) . fetchFromGitHub {
2019-02-15 09:04:03 +01:00
owner = " s t a t u s - i m " ;
2019-02-01 11:44:51 +01:00
repo = " n i x p k g s " ;
2019-03-25 17:35:01 +01:00
rev = " d b 4 9 2 b 6 1 5 7 2 2 5 1 c 2 8 6 6 f 6 b 5 e 6 e 9 4 e 9 d 7 0 e 7 d 3 0 2 1 " ;
sha256 = " 1 8 8 r 7 g b c r x i 2 0 n j 6 x h 9 b m d f 3 l b j w b 9 4 v 9 s 0 w p a c l 7 q 3 9 g 1 f c a 6 6 h " ;
2019-04-03 13:06:42 +02:00
} ) { inherit config ; } ,
stdenv ? pkgs . stdenv ,
target-os ? " a l l " } :
2019-02-01 11:44:51 +01:00
2019-04-03 13:06:42 +02:00
( pkgs . callPackage ./derivation.nix { inherit pkgs target-os config ; } ) . overrideAttrs ( _ : {
src = null ;
# TODO: Figure out if there's a better way to do this
# NOTE: There's a weird difference in behavior between Linux and macOS: in Linux the packages will only be fetched by `nix build` if unpackPhase exists. In macOS it's the other way around :-/
phases = with stdenv ; lib . optional isLinux [ " u n p a c k P h a s e " ] ++ [ " n o P h a s e " ] ;
unpackPhase = " t r u e " ;
noPhase = " m k d i r - p $ o u t " ;
} )