Set up a Nix development environment
mainIf you have Nix 2.4 or later, you can use a Nix flake to manage the environment. The flake provides Java, make, curl, and git, and uses a repo-local Android SDK located in ./android-sdk.
Interactive Shell
To enter the development environment:
alias nix='nix --extra-experimental-features "nix-command flakes"'
nix developOne-shot Commands
To run commands without entering an interactive shell:
nix develop --command make androidsdk
nix develop --command make tailscale-debugFast Kotlin Iteration
To iterate on Kotlin code quickly without running the full gomobile bind step:
nix develop --command bash -lc 'cd android && ./gradlew ktfmtCheck compileDebugKotlin'Note: On first use, you must install the Android SDK components via make androidsdk. The resulting debug APK will be written to ./tailscale-debug.apk.
alias nix='nix --extra-experimental-features "nix-command flakes"'
nix develop
# Install SDK components
make androidsdk
# Build debug APK
make tailscale-debug