github.com/Seikaijyu/gio@v0.0.1/flake.nix (about) 1 # SPDX-License-Identifier: Unlicense OR MIT 2 { 3 description = "Gio build environment"; 4 5 inputs = { 6 nixpkgs.url = "github:NixOS/nixpkgs/23.11"; 7 android.url = "github:tadfisher/android-nixpkgs"; 8 android.inputs.nixpkgs.follows = "nixpkgs"; 9 }; 10 11 outputs = { self, nixpkgs, android }: 12 let 13 supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-darwin" ]; 14 forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f system); 15 in 16 { 17 devShells = forAllSystems 18 (system: 19 let 20 pkgs = import nixpkgs { 21 inherit system; 22 }; 23 android-sdk = android.sdk.${system} (sdkPkgs: with sdkPkgs; 24 [ 25 build-tools-31-0-0 26 cmdline-tools-latest 27 platform-tools 28 platforms-android-31 29 ndk-bundle 30 ]); 31 in 32 { 33 default = with pkgs; mkShell 34 ({ 35 ANDROID_SDK_ROOT = "${android-sdk}/share/android-sdk"; 36 JAVA_HOME = jdk17.home; 37 packages = [ 38 android-sdk 39 jdk17 40 clang 41 ] ++ (if stdenv.isLinux then [ 42 vulkan-headers 43 libxkbcommon 44 wayland 45 xorg.libX11 46 xorg.libXcursor 47 xorg.libXfixes 48 libGL 49 pkg-config 50 ] else if stdenv.isDarwin then [ 51 darwin.apple_sdk_11_0.frameworks.Foundation 52 darwin.apple_sdk_11_0.frameworks.Metal 53 darwin.apple_sdk_11_0.frameworks.QuartzCore 54 darwin.apple_sdk_11_0.frameworks.AppKit 55 darwin.apple_sdk_11_0.MacOSX-SDK 56 ] else [ ]); 57 } // (if stdenv.isLinux then { 58 LD_LIBRARY_PATH = "${vulkan-loader}/lib"; 59 } else { })); 60 } 61 ); 62 }; 63 }