Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,10 @@ nix develop # Rust toolchain, Bun, sqlx, zig, cargo-zigbuild
just run_local # local infra + backend services + proxy + frontend
```

Tauri's large platform dependencies live in focused shells: use
`nix develop .#tauri-linux` for Linux desktop development or
`nix develop .#tauri-android` for Android development on x86_64 Linux.

`run_local` prints the frontend URL once the stack is up; `r` rebuilds changed Rust services, `q` tears it down. See [Running locally](docs/RUNNING_LOCALLY.md) for Doppler setup and named instances.

```bash
Expand Down
11 changes: 10 additions & 1 deletion apps/web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,17 @@ You will need the following dependencies installed on your system to develop in
1. *For Android Development* The [Android Studio IDE](https://developer.android.com/studio)
1. *For iOS Development* [XCode](https://developer.apple.com/xcode/) for MacOS

If you do not want to manage these dependencies manually, it is recommended to use `nix develop`
The default shell contains the shared frontend and Tauri CLI tooling. Use the
focused shells when developing targets with large platform dependencies:

```bash
nix develop .#tauri-linux # GTK/WebKitGTK/GStreamer desktop stack
nix develop .#tauri-android # Android Studio, SDK/NDK, emulator, and Rust targets
```

`tauri-android` is available on x86_64 Linux. On macOS, use the default shell
with the platform IDE installed outside Nix (Xcode for iOS or Android Studio
for Android).

### Running Tauri

Expand Down
4 changes: 2 additions & 2 deletions apps/web/docs/graphql-cache-optimistic-enqueue-claim-plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -393,10 +393,10 @@ Run the focused frontend tests for:
- `tauri-host.test.ts`
- grouped optimistic property tests

Then run the Tauri plugin tests using the established JS-app shell:
Then run the Tauri plugin tests using the Linux Tauri shell:

```bash
nix develop .#js-app --command cargo test \
nix develop .#tauri-linux --command cargo test \
--manifest-path apps/web/tauri/graphql_cache_plugin/Cargo.toml
```

Expand Down
4 changes: 2 additions & 2 deletions crates/client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ Normalized GraphQL cache with disk-backed persistence for urql. Design doc:
The Tauri host lives in the tauri workspace (it needs the patched tauri fork
pinned there): `apps/web/tauri/graphql_cache_plugin`, path-depending on
`cache-core`/`cache-sqlite`. Test it from `apps/web/tauri` with
`cargo test -p graphql_cache_plugin` (on NixOS use the `js-app` dev shell —
tauri's Linux desktop stack needs its webkitgtk/dbus system libs).
`cargo test -p graphql_cache_plugin` (on NixOS use the `tauri-linux` dev shell —
Tauri's Linux desktop stack needs its WebKitGTK/DBus system libraries).

## Tests

Expand Down
5 changes: 5 additions & 0 deletions nix/cloud-storage.nix
Original file line number Diff line number Diff line change
Expand Up @@ -666,12 +666,14 @@
parallel
docker-compose
curl
wget
kcat
xz
unzip
zip
cargo-info
cargo-udeps
cargo-tauri
cargo-lambda
cargo-zigbuild
zig
Expand Down Expand Up @@ -713,6 +715,9 @@
nodejs_24
pulumi
pulumiPackages.pulumi-nodejs
pulumiPackages.pulumi-aws-native
playwright
playwright-mcp
doppler
biome
jq
Expand Down
173 changes: 0 additions & 173 deletions nix/js-app.nix

This file was deleted.

117 changes: 117 additions & 0 deletions nix/tauri-dev-shells.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
{ inputs, ... }:
{
perSystem =
{ config, system, ... }:
let
inherit (inputs)
nixpkgs
fenix
;
pkgs = import nixpkgs {
inherit system;
};
lib = pkgs.lib;
isLinux = pkgs.stdenv.isLinux;
isX86_64Linux = system == "x86_64-linux";

# Android Studio is unfree, and the composed SDK requires accepting the
# Android SDK license. Keep this package set isolated from the default
# shell so ordinary development does not pull in the mobile toolchain.
tauriPkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
config.android_sdk.accept_license = true;
};

androidSdk =
(tauriPkgs.androidenv.composeAndroidPackages {
platformVersions = [
"34"
"36"
];
buildToolsVersions = [ "35.0.0" ];
ndkVersions = [ "26.3.11579264" ];
includeNDK = true;
useGoogleAPIs = false;
useGoogleTVAddOns = false;
includeEmulator = true;
includeSystemImages = true;
systemImageTypes = [ "google_apis_playstore" ];
abiVersions = [ "x86_64" ];
includeSources = false;
}).androidsdk;

androidRustToolchain =
with fenix.packages.${system};
combine [
complete.rustc
complete.rust-src
complete.cargo
complete.clippy
complete.rustfmt
complete.rust-analyzer
targets.wasm32-unknown-unknown.latest.rust-std
targets.aarch64-linux-android.latest.rust-std
targets.armv7-linux-androideabi.latest.rust-std
targets.i686-linux-android.latest.rust-std
targets.x86_64-linux-android.latest.rust-std
];

tauriLinuxPackages = with tauriPkgs; [
gst_all_1.gstreamer
gst_all_1.gst-plugins-base
gst_all_1.gst-plugins-good
gst_all_1.gst-plugins-bad
xdg-utils
];

tauriLinuxLibraries = with tauriPkgs; [
gtk3
libsoup_3
webkitgtk_4_1
cairo
gdk-pixbuf
glib
dbus
openssl
librsvg
lsb-release
];

tauriLinuxShellHook = ''
export LD_LIBRARY_PATH="${lib.makeLibraryPath tauriLinuxLibraries}''${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
export XDG_DATA_DIRS="${tauriPkgs.gsettings-desktop-schemas}/share/gsettings-schemas/${tauriPkgs.gsettings-desktop-schemas.name}:${tauriPkgs.gtk3}/share/gsettings-schemas/${tauriPkgs.gtk3.name}''${XDG_DATA_DIRS:+:$XDG_DATA_DIRS}"
'';
in
{
devShells =
lib.optionalAttrs isLinux {
tauri-linux = config.devShells.default.overrideAttrs (old: {
buildInputs = (old.buildInputs or [ ]) ++ tauriLinuxPackages ++ tauriLinuxLibraries;
shellHook = (old.shellHook or "") + tauriLinuxShellHook;
GIO_MODULE_DIR = "${tauriPkgs.glib-networking}/lib/gio/modules/";
});
}
// lib.optionalAttrs isX86_64Linux {
tauri-android = config.devShells.default.overrideAttrs (old: {
# Put the Android-capable toolchain before the default toolchain and
# explicitly prepend it to PATH below so rustc can find every
# Android target regardless of mkShell input ordering.
buildInputs = [
androidRustToolchain
tauriPkgs.jdk
androidSdk
tauriPkgs.android-studio
]
++ (old.buildInputs or [ ]);
shellHook = (old.shellHook or "") + ''
export PATH="${androidRustToolchain}/bin:$PATH"
'';
ANDROID_HOME = "${androidSdk}/libexec/android-sdk";
ANDROID_SDK_ROOT = "${androidSdk}/libexec/android-sdk";
NDK_HOME = "${androidSdk}/libexec/android-sdk/ndk/26.3.11579264";
GRADLE_OPTS = "-Dorg.gradle.project.android.aapt2FromMavenOverride=${androidSdk}/libexec/android-sdk/build-tools/35.0.0/aapt2";
});
};
};
}
Loading