flake.*: upgrade to nixpkgs 25.05, use nixpkgs android SDK

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2025-05-24 09:37:35 +02:00
parent 0225334124
commit 0a209f7d39
2 changed files with 61 additions and 107 deletions
+37 -40
View File
@@ -3,42 +3,38 @@
description = "Gio build environment";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
android.url = "github:tadfisher/android-nixpkgs";
android.inputs.nixpkgs.follows = "nixpkgs";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, android }:
let
supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-darwin" ];
forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f system);
in
{
devShells = forAllSystems
(system:
let
pkgs = import nixpkgs {
inherit system;
outputs = { self, nixpkgs, utils }:
utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
# allow unfree Android packages.
config.allowUnfree = true;
# accept the Android SDK license.
config.android_sdk.accept_license = true;
};
in {
devShells = let
android-sdk = let
androidComposition = pkgs.androidenv.composeAndroidPackages {
platformVersions = [ "latest" ];
abiVersions = [ "armeabi-v7a" "arm64-v8a" ];
# Omit the deprecated tools package.
toolsVersion = null;
includeNDK = true;
};
android-sdk = android.sdk.${system} (sdkPkgs: with sdkPkgs;
[
build-tools-31-0-0
cmdline-tools-latest
platform-tools
platforms-android-31
ndk-bundle
]);
in
{
default = with pkgs; mkShell
({
ANDROID_SDK_ROOT = "${android-sdk}/share/android-sdk";
JAVA_HOME = jdk17.home;
packages = [
android-sdk
jdk17
clang
] ++ (if stdenv.isLinux then [
in androidComposition.androidsdk;
in {
default = with pkgs;
mkShell (rec {
ANDROID_HOME = "${android-sdk}/libexec/android-sdk";
packages = [ android-sdk jdk clang ]
++ (if stdenv.isLinux then [
vulkan-headers
libxkbcommon
wayland
@@ -47,11 +43,12 @@
xorg.libXfixes
libGL
pkg-config
] else [ ]);
} // (if stdenv.isLinux then {
LD_LIBRARY_PATH = "${vulkan-loader}/lib";
} else { }));
}
);
};
] else
[ ]);
} // (if stdenv.isLinux then {
LD_LIBRARY_PATH = "${vulkan-loader}/lib";
} else
{ }));
};
});
}