Files
morns-keyboard-basic/shell.nix
T
Jules Aguillon 77c4a27c4c Spell checking (#1137)
This adds dictionary-based spell checking to the keyboard. The keyboard looks at the word being typed and matches it against a dictionary to either complete the rest of the word or find alternative spellings.

The core of this feature is implemented in cdict, which is included as a
submodule in vendor/cidct.

Cdict is developped at https://github.com/Julow/cdict
The dictionaries are hosted at https://github.com/Julow/Unexpected-Keyboard-dictionaries/
The wordlists used to build the dictionaries are the same ones used by
HeliBoard from https://codeberg.org/Helium314/aosp-dictionaries

- Add an activity accessible from the launcher app that lists available
  dictionaries with a download button.
  The DictionaryListView view shows the list of available dictionaries and
  handles downloading and installing them.

- The Dictionaries class manages installed dictionaries. Dictionaries are
  installed as individual files into the app's private directory.

- Available dictionaries are listed in dictionaries.xml, which is generated
  when building Unexpected-Keyboard-dictionaries.
  method.xml mentions the dictionary name for each locales.
2026-02-02 00:20:00 +01:00

62 lines
1.9 KiB
Nix

{ pkgs ? import <nixpkgs> {
config.android_sdk.accept_license = true;
config.allowUnfree = true;
} }:
let
jdk = pkgs.openjdk17;
build_tools_version = "35.0.0";
android = pkgs.androidenv.composeAndroidPackages {
buildToolsVersions = [ build_tools_version ];
platformVersions = [ "35" ];
abiVersions = [ "armeabi-v7a" ];
includeNDK = true;
ndkVersion = "27.0.12077973";
};
emulators = let
mk_emulator = { platformVersion, device ? "pixel_6", abiVersion ? "x86_64", systemImageType ? "default" }:
pkgs.androidenv.emulateApp rec {
name = "emulator_api${platformVersion}";
inherit platformVersion abiVersion systemImageType;
androidAvdFlags = "--device ${device}";
};
# Allow to install several emulators in the same environment
link_emulator = version_name: args: {
name = "bin/emulate_android_${version_name}";
path = "${mk_emulator args}/bin/run-test-emulator";
};
in pkgs.linkFarm "emulator" [
(link_emulator "5" { platformVersion = "21"; })
# (link_emulator "14" { platformVersion = "34"; })
# There's no 'default' image for Android 15
(link_emulator "15" { platformVersion = "35"; systemImageType = "google_apis"; })
];
ANDROID_SDK_ROOT = "${android.androidsdk}/libexec/android-sdk";
gradle = pkgs.gradle.override { java = jdk; };
# Without this option, aapt2 fails to run with a permissions error.
gradle_wrapped = pkgs.runCommandLocal "gradle-wrapped" {
nativeBuildInputs = with pkgs; [ makeBinaryWrapper ];
} ''
mkdir -p $out/bin
ln -s ${gradle}/bin/gradle $out/bin/gradle
wrapProgram $out/bin/gradle \
--add-flags "-Dorg.gradle.project.android.aapt2FromMavenOverride=${ANDROID_SDK_ROOT}/build-tools/${build_tools_version}/aapt2"
'';
in pkgs.mkShell {
buildInputs = [
pkgs.findutils
pkgs.fontforge
jdk
android.androidsdk
gradle_wrapped
emulators
];
JAVA_HOME = jdk.home;
inherit ANDROID_SDK_ROOT;
}