Something went wrong. Try again.
honestly just guess what it does. You're probably right.
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081{ description = "tsbutt development environment (Go, gomobile, Android SDK/NDK, Gradle)";
inputs = { # nixpkgs-unstable, 2026-10-16 nixpkgs.url = "github:NixOS/nixpkgs/f20cd90e28fe0403873f473b29e42662cd86e8c4"; };
outputs = { self, nixpkgs }: let systems = [ "x86_64-linux" "aarch64-linux" ]; forAllSystems = nixpkgs.lib.genAttrs systems; in { devShells = forAllSystems (system: let pkgs = import nixpkgs { inherit system; config = { android_sdk.accept_license = true; allowUnfree = true; }; };
# Pinned golang.org/x/mobile revision used to install gomobile. # Newest revision as of 2026-10-16; compatible with go 1.27 and # tailscale.com v1.104.1. Recorded in tsbridge/README.md. gomobileVersion = "v0.0.0-20261011034528-197770444867";
jdk = pkgs.jdk21;
androidSdk = pkgs.androidenv.composeAndroidPackages { includeNDK = true; # android-26: gomobile's -androidapi target for `gomobile bind`. # android-35: compileSdk for the Android app (keep in sync with # app/build.gradle.kts). platformVersions = [ "26" "35" ]; buildToolsVersions = [ "34.0.0" "35.0.0" ]; abiVersions = [ "arm64-v8a" ]; includeEmulator = false; }; androidHome = "${androidSdk.androidsdk}/libexec/android-sdk"; ndkHome = "${androidSdk.ndk-bundle}/libexec/android-sdk/ndk-bundle"; in { default = pkgs.mkShell { buildInputs = with pkgs; [ go_1_27 # 1.27.2; tailscale.com v1.104.1 requires >= 1.27.1 jdk gradle_8 # 8.14.4 unzip which curl # used to vendor buttplug.mjs intiface-central androidSdk.androidsdk ];
ANDROID_HOME = androidHome; ANDROID_NDK_HOME = ndkHome; JAVA_HOME = "${jdk.home}";
shellHook = '' export PATH="$JAVA_HOME/bin:$PATH"
# Install the pinned gomobile into the repo (not $HOME) so the # toolchain is self-contained and Phase-6 clean-room rebuilds # regenerate it deterministically. export GOBIN="$PWD/.tools/bin" export PATH="$GOBIN:$PATH" if [ ! -x "$GOBIN/gomobile" ]; then echo ">> installing pinned gomobile (${gomobileVersion})" go install golang.org/x/mobile/cmd/gomobile@${gomobileVersion} go install golang.org/x/mobile/cmd/gobind@${gomobileVersion} gomobile init fi ''; }; }); };}