diff --git a/pkgs/development/mobile/androidenv/compose-android-packages.nix b/pkgs/development/mobile/androidenv/compose-android-packages.nix index 1803a04a6638..44259a2f2e48 100644 --- a/pkgs/development/mobile/androidenv/compose-android-packages.nix +++ b/pkgs/development/mobile/androidenv/compose-android-packages.nix @@ -631,32 +631,32 @@ lib.recurseIntoAttrs rec { # This derivation deploys the tools package and symlinks all the desired # plugins that we want to use. If the license isn't accepted, prints all the licenses # requested and throws. - androidsdk = - if !licenseAccepted then - throw '' - ${builtins.concatStringsSep "\n\n" (mkLicenseTexts licenseNames)} + androidsdk = callPackage ./cmdline-tools.nix { + inherit + deployAndroidPackage + os + arch + meta + ; - You must accept the following licenses: - ${lib.concatMapStringsSep "\n" (str: " - ${str}") licenseNames} + package = cmdline-tools-package; - a) - by setting nixpkgs config option 'android_sdk.accept_license = true;'. - b) - by an environment variable for a single invocation of the nix tools. - $ export NIXPKGS_ACCEPT_ANDROID_SDK_LICENSE=1 - '' - else - callPackage ./cmdline-tools.nix { - inherit - deployAndroidPackage - os - arch - meta - ; + postInstall = + if !licenseAccepted then + throw '' + ${builtins.concatStringsSep "\n\n" (mkLicenseTexts licenseNames)} - package = cmdline-tools-package; + You must accept the following licenses: + ${lib.concatMapStringsSep "\n" (str: " - ${str}") licenseNames} - postInstall = '' + a) + by setting nixpkgs config option 'android_sdk.accept_license = true;'. + b) + by an environment variable for a single invocation of the nix tools. + $ export NIXPKGS_ACCEPT_ANDROID_SDK_LICENSE=1 + '' + else + '' # Symlink all requested plugins ${linkPlugin { name = "platform-tools"; @@ -769,5 +769,5 @@ lib.recurseIntoAttrs rec { '' ) licenseNames} ''; - }; + }; }