Skip to content

Commit

Permalink
chore: add nix flake
Browse files Browse the repository at this point in the history
  • Loading branch information
limwa committed Nov 30, 2024
1 parent a7c88b7 commit 7295342
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 0 deletions.
27 changes: 27 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 44 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
description = "A very basic flake";

inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
};

outputs = { self, nixpkgs }:
let
system = "x86_64-linux";

pkgs = import nixpkgs {
inherit system;
config = {
allowUnfree = true;
android_sdk.accept_license = true;
};
};

androidComposition = pkgs.androidenv.composeAndroidPackages {
platformVersions = [ "31" "33" "34" ];
buildToolsVersions = [ "34.0.0" ];
includeNDK = true;
includeEmulator = true;
includeSystemImages = true;
};

androidSdk = androidComposition.androidsdk;
in {

devShell.${system} = pkgs.mkShell {
packages = with pkgs; [
flutter
jdk17
androidSdk
];

shellHook = ''
export ANDROID_HOME="${androidSdk}/libexec/android-sdk"
export JAVA_HOME="${pkgs.jdk17}"
'';
};
};
}

0 comments on commit 7295342

Please sign in to comment.