abouttreesummaryrefslogcommitdiff
path: root/shell.nix
diff options
context:
space:
mode:
authorJules Aguillon2022-03-23 10:23:13 +0100
committerJules Aguillon2022-03-23 13:02:38 +0100
commit3373c59b903cfcccedf31278f9f18ea305e3a567 (patch)
treed55fe718e99ed07f48a5142cb3d8574edea40d86 /shell.nix
parent0d1ddcce3f92e029a75af285927fe1ef89bb2a26 (diff)
downloadunexpected-keyboard-3373c59b903cfcccedf31278f9f18ea305e3a567.tar.gz
unexpected-keyboard-3373c59b903cfcccedf31278f9f18ea305e3a567.zip
CI: Use nixbuild.net
The build takes place on the remote, which takes advantage of Nix's caching. The previous workflow used a remote cache but in order to build locally, all the dependencies needed to be downloaded from the cache everytime. The dependencies are 462M, downloading took most of the time.
Diffstat (limited to 'shell.nix')
-rw-r--r--shell.nix32
1 files changed, 24 insertions, 8 deletions
diff --git a/shell.nix b/shell.nix
index 8036a5e..1ee5012 100644
--- a/shell.nix
+++ b/shell.nix
@@ -1,19 +1,35 @@
{ pkgs ? import <nixpkgs> {
- config.android_sdk.accept_license = true;
- config.allowUnfree = true;
- } }:
+ config.android_sdk.accept_license = true;
+ config.allowUnfree = true;
+} }:
let
- jdk = pkgs.openjdk8;
-
android = pkgs.androidenv.composeAndroidPackages {
buildToolsVersions = [ "30.0.3" ];
platformVersions = [ "30" ];
abiVersions = [ "armeabi-v7a" ];
};
-in
-pkgs.mkShell {
- buildInputs = [ pkgs.findutils jdk android.androidsdk pkgs.fontforge ];
+ buildInputs =
+ [ pkgs.findutils pkgs.openjdk8 android.androidsdk pkgs.fontforge ];
+
+ # Env variable required by the Makefile
ANDROID_HOME = "${android.androidsdk}/libexec/android-sdk";
+
+ # Build the debug APK. Exposed as an attribute, used in CI
+ debug-apk = pkgs.stdenv.mkDerivation {
+ name = "unexpected-keyboard-debug";
+ src = ./.;
+ inherit buildInputs ANDROID_HOME;
+ buildPhase = ''
+ make
+ '';
+ installPhase = ''
+ mkdir -p $out
+ mv _build/*.apk $out
+ '';
+ };
+
+in pkgs.mkShell { inherit buildInputs ANDROID_HOME; } // {
+ inherit debug-apk;
}