This repository has been archived on 2023-09-08. You can view files and clone it, but cannot push or open issues or pull requests.
moxplatform/flake.nix

76 lines
1.9 KiB
Nix
Raw Normal View History

2022-04-28 13:33:42 +00:00
{
2022-09-01 11:38:48 +00:00
description = "moxplatform";
2022-04-28 13:33:42 +00:00
inputs = {
2022-09-01 11:38:48 +00:00
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
2022-04-28 13:33:42 +00:00
flake-utils.url = "github:numtide/flake-utils";
android-nixpkgs.url = "github:tadfisher/android-nixpkgs";
2022-04-28 13:33:42 +00:00
};
outputs = { self, nixpkgs, flake-utils, android-nixpkgs }: flake-utils.lib.eachDefaultSystem (system: let
2022-04-28 13:33:42 +00:00
pkgs = import nixpkgs {
inherit system;
2022-09-01 11:38:48 +00:00
config = {
android_sdk.accept_license = true;
allowUnfree = true;
};
2022-04-28 13:33:42 +00:00
};
# Everything to make Flutter happy
sdk = android-nixpkgs.sdk.${system} (sdkPkgs: with sdkPkgs; [
cmdline-tools-latest
build-tools-30-0-3
build-tools-33-0-2
build-tools-34-0-0
platform-tools
emulator
patcher-v4
platforms-android-30
platforms-android-31
platforms-android-33
]);
pinnedJDK = pkgs.jdk17;
2022-04-28 13:33:42 +00:00
in {
devShell = pkgs.mkShell {
buildInputs = with pkgs; [
# Android
pinnedJDK
sdk
# Flutter
flutter dart
# Code hygiene
gitlint
2022-08-09 12:16:11 +00:00
# Flutter dependencies for linux desktop
atk
cairo
clang
cmake
epoxy
gdk-pixbuf
glib
gtk3
harfbuzz
ninja
pango
pcre
pkg-config
xorg.libX11
xorg.xorgproto
2022-04-28 13:33:42 +00:00
];
2022-08-09 12:16:11 +00:00
# Make Flutter build on desktop
CPATH = "${pkgs.xorg.libX11.dev}/include:${pkgs.xorg.xorgproto}/include";
LD_LIBRARY_PATH = with pkgs; lib.makeLibraryPath [ atk cairo epoxy gdk-pixbuf glib gtk3 harfbuzz pango ];
ANDROID_HOME = "${sdk}/share/android-sdk";
ANDROID_SDK_ROOT = "${sdk}/share/android-sdk";
2022-04-28 13:33:42 +00:00
JAVA_HOME = pinnedJDK;
# 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";
2022-04-28 13:33:42 +00:00
};
});
}