{
description = "Flutter 3.13.x";
inputs = {
  nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
  flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
  flake-utils.lib.eachDefaultSystem (system:
    let
      pkgs = import nixpkgs {
        inherit system;
        config = {
          android_sdk.accept_license = true;
          allowUnfree = true;
        };
      };
      buildToolsVersion = "34.0.0";
      androidComposition = pkgs.androidenv.composeAndroidPackages {
        buildToolsVersions = [ buildToolsVersion "33.0.1" ];
        platformVersions = [ "34" "33" "28" ];
        abiVersions = [ "armeabi-v7a" "arm64-v8a" ];
      };
      androidSdk = androidComposition.androidsdk;
    in
    {
      devShell =
        with pkgs; mkShell rec {
          shellHook = ''
            nu
            exit
          '';
          GRADLE_OPTS = "-Dorg.gradle.project.android.aapt2FromMavenOverride=${androidSdk}/libexec/android-sdk/build-tools/33.0.1/aapt2";   

          ANDROID_SDK_ROOT = "${androidSdk}/libexec/android-sdk";
          buildInputs = [
            flutter
            androidSdk # The customized SDK that we've made above
            jdk17

            (vscode-with-extensions.override {
              vscode = vscodium;
              vscodeExtensions = with vscode-extensions; [
                vscodevim.vim
                dart-code.dart-code
                dart-code.flutter
              ] ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace[
                {
                  name = "awesome-flutter-snippets";
                  publisher = "nash";
                  version = "4.0.1";
                  sha256 = "lXdos/xB18h3Z0YfkgEk55G2JvRMYudUUIltugQjylU=";
                }
              ];
            })
          ];

        };
    });
}
