Android: Difference between revisions
imported>Volth Created page with "=== Connecting Android device === ... === Building Android apps using Nix === Some software (for example Tinc VPN) have Android client which can be built together with the N..." |
imported>DIzFer No edit summary |
||
| Line 10: | Line 10: | ||
=== Android Studio on NixOS === | === Android Studio on NixOS === | ||
... | ... | ||
=== Building Android on NixOS === | |||
It's possible to use nix-shell with buildFHSUserEnv to set up an environment in which it's viable to build Android without huge amounts of editing. This is an example shell.nix file. | |||
<syntaxhighlight lang="nix"> | |||
{ pkgs ? import <nixpkgs> {} }: | |||
let fhs = pkgs.buildFHSUserEnv { | |||
name = "android-env"; | |||
targetPkgs = pkgs: with pkgs; | |||
[ git | |||
gitRepo | |||
gnupg | |||
python2 | |||
curl | |||
procps | |||
openssl | |||
gnumake | |||
nettools | |||
androidenv.platformTools | |||
jdk | |||
schedtool | |||
utillinux | |||
m4 | |||
gperf | |||
perl | |||
libxml2 | |||
zip | |||
unzip | |||
bison | |||
flex | |||
lzop | |||
]; | |||
multiPkgs = pkgs: with pkgs; | |||
[ zlib | |||
]; | |||
runScript = "bash"; | |||
profile = '' | |||
export USE_CCACHE=1 | |||
export ANDROID_JAVA_HOME=${pkgs.jdk.home} | |||
''; | |||
}; | |||
in pkgs.stdenv.mkDerivation { | |||
name = "android-env-shell"; | |||
nativeBuildInputs = [ fhs ]; | |||
shellHook = "exec android-env"; | |||
} | |||
</syntaxhighlight> | |||
[https://nixos.org/nix-dev/2015-April/016881.html Source] | |||