summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaghuram Subramani <raghus2247@gmail.com>2024-12-02 10:40:08 +0000
committerRaghuram Subramani <raghus2247@gmail.com>2024-12-02 10:40:08 +0000
commit62620d233ad030e76d30563838ffc9d53f07df40 (patch)
treeeef0baa7102ffa25af30f3c6bc705b95d536b82d
parent797054901742e7209b6c8181fb156cf2e61e2c0d (diff)
add shell.nix
-rw-r--r--shell.nix76
1 files changed, 76 insertions, 0 deletions
diff --git a/shell.nix b/shell.nix
new file mode 100644
index 0000000..84b9d86
--- /dev/null
+++ b/shell.nix
@@ -0,0 +1,76 @@
+# nix-shell --pure
+
+{pkgs ? import <nixpkgs> {}}: let
+ fhs = pkgs.buildFHSUserEnv {
+ name = "android-env";
+ targetPkgs = pkgs:
+ with pkgs; [
+ android-tools
+ libxcrypt-legacy # libcrypt.so.1
+ freetype # libfreetype.so.6
+ fontconfig # java NPE: "sun.awt.FontConfiguration.head" is null
+ yaml-cpp # necessary for some kernels according to a comment on the gist
+
+ bc
+ binutils
+ bison
+ ccache
+ curl
+ flex
+ gcc
+ git
+ git-repo
+ git-lfs
+ gnumake
+ gnupg
+ gperf
+ imagemagick
+ elfutils
+ libxml2
+ libxslt
+ lz4
+ lzop
+ m4
+ nettools
+ openssl.dev
+ # perl
+ pngcrush
+ procps
+ python3
+ rsync
+ schedtool
+
+ /* SDL */
+ squashfsTools
+ unzip
+ util-linux
+ xml2
+ zip
+ ];
+ multiPkgs = pkgs:
+ with pkgs; [
+ zlib
+ ncurses5
+ libcxx
+ readline
+
+ libgcc # crtbeginS.o
+ # iconv # ??? - i put this here and by the time i went back to remove unecessary packages i forgot why
+ iconv.dev # sys/types.h
+ ];
+ profile = ''
+ export ALLOW_NINJA_ENV=true
+ export USE_CCACHE=1
+ export CCACHE_EXEC=/usr/bin/ccache
+ export ANDROID_JAVA_HOME=${pkgs.jdk11.home}
+ # Building involves a phase of unzipping large files into a temporary directory
+ export TMPDIR=/tmp
+ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${pkgs.ncurses5}/lib
+ '';
+ };
+in
+ pkgs.stdenv.mkDerivation {
+ name = "android-env-shell";
+ nativeBuildInputs = [fhs];
+ shellHook = "exec android-env";
+ }