Created
May 28, 2024 16:01
-
-
Save inscapist/70ea328b59d17b234c14e14b505f81b2 to your computer and use it in GitHub Desktop.
Revisions
-
inscapist created this gist
May 28, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,65 @@ { description = "Flutter on NixOS."; inputs = { # We disable this to use indirect nixpkgs from android-nixpkgs # nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; flake-utils.url = "github:numtide/flake-utils"; android-nixpkgs.url = "github:tadfisher/android-nixpkgs"; }; outputs = { flake-utils, nixpkgs, android-nixpkgs, ... }: flake-utils.lib.eachDefaultSystem ( system: let pkgs = import nixpkgs { inherit system; config = { android_sdk.accept_license = true; allowUnfree = true; }; }; pinnedJDK = pkgs.jdk17; sdk = android-nixpkgs.sdk.${system} ( sdkPkgs: with sdkPkgs; [ build-tools-30-0-3 build-tools-33-0-2 build-tools-34-0-0 platforms-android-30 platforms-android-31 platforms-android-34 cmdline-tools-latest platform-tools # emulator ] ); in { devShell = pkgs.mkShell { JAVA_HOME = pinnedJDK.home; ANDROID_HOME = "${sdk}/share/android-sdk"; # Fix an issue with Flutter using an older version of aapt2, which does not know # an used parameter. GRADLE_OPTS = "-Dorg.gradle.project.android.aapt2FromMavenOverride=${sdk}/share/android-sdk/build-tools/34.0.0/aapt2"; # CHROME_EXECUTABLE = "${pkgs.brave}/bin/brave"; buildInputs = with pkgs; [ pinnedJDK sdk flutter # pkgs.androidStudioPackages.stable # android-studio ]; }; } ); }