From 031dcaeeac7d4fcbe80bbc3cc764b1ed77acca05 Mon Sep 17 00:00:00 2001 From: Moritz Angermann Date: Thu, 15 Oct 2026 17:52:26 +0900 Subject: [PATCH] Keep Android SDK permission scoped to its package imports --- flake.nix | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/flake.nix b/flake.nix index 65a89be66e..9b33500824 100644 --- a/flake.nix +++ b/flake.nix @@ -20,23 +20,17 @@ aarch64-android-prebuilt = import prev.path { inherit system; inherit (prev) overlays; - # Nixpkgs marks the prebuilt NDK, SDK tools, and wrappers unfree. - config = prev.config // { - allowUnfreePredicate = package: - let name = prev.lib.getName package; in - prev.lib.hasInfix "ndk" name || prev.lib.hasPrefix "android-sdk-" name; - }; + # Permit the SDK/NDK's unfree packages only in these Android sets. + # Some SDK fetchers use unprefixed names such as platform-tools. + config = prev.config // { allowUnfree = true; }; crossSystem = prev.lib.systems.examples.aarch64-android-prebuilt // { androidSdkVersion = "26"; }; }; armv7a-android-prebuilt = import prev.path { inherit system; inherit (prev) overlays; - # Nixpkgs marks the prebuilt NDK, SDK tools, and wrappers unfree. - config = prev.config // { - allowUnfreePredicate = package: - let name = prev.lib.getName package; in - prev.lib.hasInfix "ndk" name || prev.lib.hasPrefix "android-sdk-" name; - }; + # Permit the SDK/NDK's unfree packages only in these Android sets. + # Some SDK fetchers use unprefixed names such as platform-tools. + config = prev.config // { allowUnfree = true; }; crossSystem = prev.lib.systems.examples.armv7a-android-prebuilt // { androidSdkVersion = "26"; }; }; };