From 4aa6bf3586caa14ba42148d7788f58baaeed9b69 Mon Sep 17 00:00:00 2001 From: Dmitry Voronin Date: Thu, 8 Feb 2024 19:36:27 +0300 Subject: [PATCH] Flake : Add Android and TODO_Lualatex templates. --- .config/linux/flake/template/Android.nix | 105 ++++++++++++++++++ .../linux/flake/template/TODO_Lualatex.nix | 1 + 2 files changed, 106 insertions(+) create mode 100644 .config/linux/flake/template/Android.nix create mode 100644 .config/linux/flake/template/TODO_Lualatex.nix diff --git a/.config/linux/flake/template/Android.nix b/.config/linux/flake/template/Android.nix new file mode 100644 index 0000000..002405a --- /dev/null +++ b/.config/linux/flake/template/Android.nix @@ -0,0 +1,105 @@ +{ + description = "FMP Android dev environment."; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + }; + + outputs = { self, nixpkgs } @inputs: + let + system = "x86_64-linux"; + lib = nixpkgs.lib; + pkgs = import nixpkgs { + system = system; + config = { + allowUnfree = true; + android_sdk.accept_license = true; + }; + }; + jdk = pkgs.jdk11; + buildTools = "31.0.0"; + androidComposition = pkgs.androidenv.composeAndroidPackages { + abiVersions = [ "armeabi-v7a" "arm64-v8a" ]; + buildToolsVersions = [ buildTools ]; + cmdLineToolsVersion = "8.0"; + includeEmulator = false; + includeNDK = false; + includeSources = false; + includeSystemImages = false; + platformToolsVersion = "34.0.5"; + platformVersions = [ "31" ]; + toolsVersion = "26.1.1"; + useGoogleAPIs = false; + useGoogleTVAddOns = false; + # cmakeVersions = [ "3.10.2" ]; + # emulatorVersion = "30.3.4"; + # includeExtras = [ "extras;google;gcm" ]; + # ndkVersions = ["22.0.7026061"]; + # systemImageTypes = [ "google_apis_playstore" ]; + }; + androidSdk = androidComposition.androidsdk; + tex = (pkgs.texlive.combine { + inherit (pkgs.texlive) scheme-basic + amsmath + babel + capt-of + catchfile + collection-fontsextra + cyrillic + dvipng + dvisvgm + environ + etoolbox + fancyhdr + fontspec + geometry + hyperref + luacode + luatexbase + montserrat + parskip + pgf + tcolorbox + tocloft + ulem + wrapfig + xcolor; + + #(setq org-latex-compiler "lualatex") + #(setq org-preview-latex-default-process 'dvisvgm) + }); + in { + devShells.${system} = { + default = pkgs.mkShell { + inputsFrom = with self.devShells.${system}; [ dev doc ]; + }; + + dev = pkgs.mkShell rec { + nativeBuildInputs = with pkgs; [ + android-tools + androidSdk + glibc + gnumake + jdk + ]; + buildInputs = with pkgs; []; + + GRADLE_OPTS = "-Dorg.gradle.project.android.aapt2FromMavenOverride=${androidSdk}/libexec/android-sdk/build-tools/${buildTools}/aapt2"; + JAVA_HOME = "${jdk}"; + LD_LIBRARY_PATH = "${lib.makeLibraryPath buildInputs}"; + ANDROID_SDK_ROOT = "${androidSdk}/libexec/android-sdk/"; + }; + + doc = pkgs.mkShell rec { + nativeBuildInputs = with pkgs; [ + gnumake + jdk + tex + ]; + buildInputs = with pkgs; []; + + JAVA_HOME = "${jdk}"; + }; + }; + }; +} diff --git a/.config/linux/flake/template/TODO_Lualatex.nix b/.config/linux/flake/template/TODO_Lualatex.nix new file mode 100644 index 0000000..7aedb4d --- /dev/null +++ b/.config/linux/flake/template/TODO_Lualatex.nix @@ -0,0 +1 @@ +# TODO: Copy something from Android.nix