about summary refs log tree commit diff
path: root/pkgs/development
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2019-01-31 10:31:27 -0500
committerGitHub <noreply@github.com>2019-01-31 10:31:27 -0500
commit6182d28cab40a595dd62124bb600c579a628c346 (patch)
tree2a61c8b6d52eef0e87eb1837deb9a83ffb83a31f /pkgs/development
parent74ee7f73f83ac9bdc5e723c332b4149b61481b06 (diff)
parent9c770c4efa7847d70612e8a564b0a49cdddfc555 (diff)
downloadnixlib-6182d28cab40a595dd62124bb600c579a628c346.tar
nixlib-6182d28cab40a595dd62124bb600c579a628c346.tar.gz
nixlib-6182d28cab40a595dd62124bb600c579a628c346.tar.bz2
nixlib-6182d28cab40a595dd62124bb600c579a628c346.tar.lz
nixlib-6182d28cab40a595dd62124bb600c579a628c346.tar.xz
nixlib-6182d28cab40a595dd62124bb600c579a628c346.tar.zst
nixlib-6182d28cab40a595dd62124bb600c579a628c346.zip
Merge pull request #54915 from matthewbauer/rework-android-assert
androidenv: move licenseAccepted condition to androidsdk
Diffstat (limited to 'pkgs/development')
-rw-r--r--pkgs/development/mobile/androidenv/compose-android-packages.nix15
1 files changed, 6 insertions, 9 deletions
diff --git a/pkgs/development/mobile/androidenv/compose-android-packages.nix b/pkgs/development/mobile/androidenv/compose-android-packages.nix
index 690f9712a10c..935a4a4f2fbb 100644
--- a/pkgs/development/mobile/androidenv/compose-android-packages.nix
+++ b/pkgs/development/mobile/androidenv/compose-android-packages.nix
@@ -20,20 +20,13 @@
 , includeExtras ? []
 }:
 
-if !licenseAccepted then throw ''
-    You must accept the Android Software Development Kit License Agreement at
-    https://developer.android.com/studio/terms
-    by setting nixpkgs config option 'android_sdk.accept_license = true;'
-  ''
-else assert licenseAccepted;
-
 let
   inherit (pkgs) stdenv fetchurl makeWrapper unzip;
 
   # Determine the Android os identifier from Nix's system identifier
   os = if stdenv.system == "x86_64-linux" then "linux"
     else if stdenv.system == "x86_64-darwin" then "macosx"
-    else "No tarballs found for system architecture: ${stdenv.system}";
+    else throw "No tarballs found for system architecture: ${stdenv.system}";
 
   # Generated Nix packages
   packages = import ./generated/packages.nix {
@@ -196,7 +189,11 @@ rec {
   # This derivation deploys the tools package and symlinks all the desired
   # plugins that we want to use.
 
-  androidsdk = import ./tools.nix {
+  androidsdk = if !licenseAccepted then throw ''
+    You must accept the Android Software Development Kit License Agreement at
+    https://developer.android.com/studio/terms
+    by setting nixpkgs config option 'android_sdk.accept_license = true;'
+  '' else import ./tools.nix {
     inherit deployAndroidPackage requireFile packages toolsVersion autoPatchelfHook makeWrapper os pkgs pkgs_i686;
     inherit (stdenv) lib;