Skip to content

Instantly share code, notes, and snippets.

@pokon548
Last active January 14, 2023 01:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pokon548/334a92f21cbdb74705524ea012b20035 to your computer and use it in GitHub Desktop.
Save pokon548/334a92f21cbdb74705524ea012b20035 to your computer and use it in GitHub Desktop.
Setup magisk environment & toolchain in NixOS
{
pkgs ? import <nixpkgs> {},
unstable ? import (fetchTarball https://nixos.org/channels/nixos-unstable/nixexprs.tar.xz) {},
buildFHSUserEnv ? opt: (unstable.buildFHSUserEnv opt).env,
}:
buildFHSUserEnv rec {
name = "magisk-env";
targetPkgs = p: (with pkgs;
[
python3
openjdk11-bootstrap
zlib
gcc
android-studio
]
);
# This setting assume that you are using the default path of sdk.
# Change this if you specify the path to somewhere else.
profile = "export ANDROID_SDK_ROOT=$HOME/Android/Sdk";
runScript = "bash";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment