about summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorArtturin2024-07-25 20:09:42 +0300
committerArtturin2024-07-25 23:49:18 +0300
commit35e5943d69e0bfd7d3f265bf91f27b3c32b41d1b (patch)
treedb6356953fc90c70b3a648f9e832f02e14d56045 /lib
parent1144d46f9510b8c31d0195e8049caa0df3eb3fec (diff)
lib.systems: throw if `sdkVer` or `ndkVer` are used for android.
Those attrs have been renamed and throwing is the best way to show it,
if we only warned then the user would only get an error like this `error: Unsupported sdk: 33`
from `pkgs/top-level/darwin-packages.nix`.

If someone wants to support multiple NixOS versions then they can simply
set both attrs. (`!args ? androidSdkVersion` is for that)
Diffstat (limited to 'lib')
-rw-r--r--lib/systems/default.nix16
-rw-r--r--lib/systems/examples.nix2
2 files changed, 18 insertions, 0 deletions
diff --git a/lib/systems/default.nix b/lib/systems/default.nix
index 0b8aeda208e3..65b85c8443e8 100644
--- a/lib/systems/default.nix
+++ b/lib/systems/default.nix
@@ -257,6 +257,22 @@ let
         if final.isMacOS then "MACOSX_DEPLOYMENT_TARGET"
         else if final.isiOS then "IPHONEOS_DEPLOYMENT_TARGET"
         else null;
+
+      # Remove before 25.05
+      androidSdkVersion =
+        if (args ? sdkVer && !args ? androidSdkVersion) then
+          throw "For android `sdkVer` has been renamed to `androidSdkVersion`"
+        else if (args ? androidSdkVersion) then
+          args.androidSdkVersion
+        else
+          null;
+      androidNdkVersion =
+        if (args ? ndkVer && !args ? androidNdkVersion) then
+          throw "For android `ndkVer` has been renamed to `androidNdkVersion`"
+        else if (args ? androidSdkVersion) then
+          args.androidNdkVersion
+        else
+          null;
     } // (
       let
         selectEmulator = pkgs:
diff --git a/lib/systems/examples.nix b/lib/systems/examples.nix
index d582ecba2bed..971f6b87364b 100644
--- a/lib/systems/examples.nix
+++ b/lib/systems/examples.nix
@@ -60,6 +60,8 @@ rec {
   armv7a-android-prebuilt = {
     config = "armv7a-unknown-linux-androideabi";
     rust.rustcTarget = "armv7-linux-androideabi";
+    androidSdkVersion = "33";
+    androidNdkVersion = "26";
     useAndroidPrebuilt = true;
   } // platforms.armv7a-android;