From 7dd53baf067d5eb810307c05228ef0d2f12ab07e Mon Sep 17 00:00:00 2001 From: "Alexander \"PapaTutuWawa" Date: Thu, 20 Jul 2023 20:34:19 +0200 Subject: [PATCH] feat: Update flake to use newer Flutter --- android/build.gradle | 2 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- flake.lock | 123 ++++++++++++++++-- flake.nix | 52 ++++---- pubspec.lock | 34 ++--- 5 files changed, 163 insertions(+), 50 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 83ae220..3cdaac9 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -26,6 +26,6 @@ subprojects { project.evaluationDependsOn(':app') } -task clean(type: Delete) { +tasks.register("clean", Delete) { delete rootProject.buildDir } diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index cb24abd..ceccc3a 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip diff --git a/flake.lock b/flake.lock index e80d64b..33cec18 100644 --- a/flake.lock +++ b/flake.lock @@ -1,6 +1,66 @@ { "nodes": { + "android-nixpkgs": { + "inputs": { + "devshell": "devshell", + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1689798050, + "narHash": "sha256-ZyFPra7N0MF803o55dYQQyX9b/BmXr6QTCyN7slRThY=", + "owner": "tadfisher", + "repo": "android-nixpkgs", + "rev": "9aa0e2990da86de8ca203af313668851dcb9ea6e", + "type": "github" + }, + "original": { + "owner": "tadfisher", + "repo": "android-nixpkgs", + "type": "github" + } + }, + "devshell": { + "inputs": { + "nixpkgs": [ + "android-nixpkgs", + "nixpkgs" + ], + "systems": "systems" + }, + "locked": { + "lastModified": 1688380630, + "narHash": "sha256-8ilApWVb1mAi4439zS3iFeIT0ODlbrifm/fegWwgHjA=", + "owner": "numtide", + "repo": "devshell", + "rev": "f9238ec3d75cefbb2b42a44948c4e8fb1ae9a205", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "devshell", + "type": "github" + } + }, "flake-utils": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1689068808, + "narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { "locked": { "lastModified": 1667395993, "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", @@ -17,24 +77,71 @@ }, "nixpkgs": { "locked": { - "lastModified": 1676076353, - "narHash": "sha256-mdUtE8Tp40cZETwcq5tCwwLqkJVV1ULJQ5GKRtbshag=", - "owner": "AtaraxiaSjel", + "lastModified": 1689679375, + "narHash": "sha256-LHUC52WvyVDi9PwyL1QCpaxYWBqp4ir4iL6zgOkmcb8=", + "owner": "NixOS", "repo": "nixpkgs", - "rev": "5deb99bdccbbb97e7562dee4ba8a3ee3021688e6", + "rev": "684c17c429c42515bafb3ad775d2a710947f3d67", "type": "github" }, "original": { - "owner": "AtaraxiaSjel", - "ref": "update/flutter", + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1689631193, + "narHash": "sha256-AGSkBZaiTODQc8eT1rZDrQIjtb8JtFwJ0wVPzArlrnM=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "57695599bdc4f7bfe5d28cfa23f14b3d8bdf8a5f", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } }, "root": { "inputs": { - "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs" + "android-nixpkgs": "android-nixpkgs", + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs_2" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" } } }, diff --git a/flake.nix b/flake.nix index 1e3d376..61bf36d 100644 --- a/flake.nix +++ b/flake.nix @@ -1,11 +1,12 @@ { description = "AniTrack"; inputs = { - nixpkgs.url = "github:AtaraxiaSjel/nixpkgs/update/flutter"; + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; flake-utils.url = "github:numtide/flake-utils"; + android-nixpkgs.url = "github:tadfisher/android-nixpkgs"; }; - outputs = { self, nixpkgs, flake-utils }: flake-utils.lib.eachDefaultSystem (system: let + outputs = { self, nixpkgs, android-nixpkgs, flake-utils }: flake-utils.lib.eachDefaultSystem (system: let pkgs = import nixpkgs { inherit system; config = { @@ -13,36 +14,41 @@ allowUnfree = true; }; }; - android = pkgs.androidenv.composeAndroidPackages { - # TODO: Find a way to pin these - #toolsVersion = "26.1.1"; - #platformToolsVersion = "31.0.3"; - #buildToolsVersions = [ "31.0.0" ]; - #includeEmulator = true; - #emulatorVersion = "30.6.3"; - platformVersions = [ "28" ]; - includeSources = false; - includeSystemImages = true; - systemImageTypes = [ "default" ]; - abiVersions = [ "x86_64" ]; - includeNDK = false; - useGoogleAPIs = false; - useGoogleTVAddOns = false; - }; pinnedJDK = pkgs.jdk17; - pythonEnv = pkgs.python3.withPackages (ps: with ps; [ - requests pyyaml # For the build scripts + # 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 ]); in { devShell = pkgs.mkShell { buildInputs = with pkgs; [ - flutter pinnedJDK android.platform-tools dart scrcpy # Flutter/Android - gitlint jq # Code hygiene - ripgrep # General utilities + # Android + sdk + + # Flutter + flutter dart scrcpy pinnedJDK + + # Code hygiene + gitlint ]; JAVA_HOME = pinnedJDK; + ANDROID_HOME = "${sdk}/share/android-sdk"; + ANDROID_SDK_ROOT = "${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"; }; }); } diff --git a/pubspec.lock b/pubspec.lock index 24e1150..594aeee 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -37,10 +37,10 @@ packages: dependency: transitive description: name: async - sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" url: "https://pub.dev" source: hosted - version: "2.10.0" + version: "2.11.0" bloc: dependency: "direct main" description: @@ -157,10 +157,10 @@ packages: dependency: transitive description: name: characters - sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.3.0" checked_yaml: dependency: transitive description: @@ -197,10 +197,10 @@ packages: dependency: "direct main" description: name: collection - sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0 + sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" url: "https://pub.dev" source: hosted - version: "1.17.0" + version: "1.17.1" convert: dependency: transitive description: @@ -468,10 +468,10 @@ packages: dependency: transitive description: name: js - sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7" + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 url: "https://pub.dev" source: hosted - version: "0.6.5" + version: "0.6.7" json2yaml: dependency: transitive description: @@ -516,10 +516,10 @@ packages: dependency: transitive description: name: matcher - sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72" + sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" url: "https://pub.dev" source: hosted - version: "0.12.13" + version: "0.12.15" material_color_utilities: dependency: transitive description: @@ -532,10 +532,10 @@ packages: dependency: transitive description: name: meta - sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.9.1" mime: dependency: transitive description: @@ -572,10 +572,10 @@ packages: dependency: "direct main" description: name: path - sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" url: "https://pub.dev" source: hosted - version: "1.8.2" + version: "1.8.3" path_provider: dependency: transitive description: @@ -897,10 +897,10 @@ packages: dependency: transitive description: name: test_api - sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206 + sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb url: "https://pub.dev" source: hosted - version: "0.4.16" + version: "0.5.1" timing: dependency: transitive description: @@ -1054,5 +1054,5 @@ packages: source: hosted version: "3.1.1" sdks: - dart: ">=2.18.4 <3.0.0" + dart: ">=3.0.0-0 <4.0.0" flutter: ">=3.3.0"