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
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,15 @@ Built with Holochain + Tauri + SvelteKit + TailWind + Skeleton

## Developer Notes

Volla Messages is a Holochain application deployed using [p2pShipyard](https://darksoil.studio/p2p-shipyard/) for Mobile and Desktop.
Volla Messages is a Holochain application deployed using [p2pShipyard](https://darksoil.studio/p2p-shipyard/) for Mobile and Desktop.

Note: the `tauri-plugin-holochain` dependency is pinned to an exact rev of
`darksoil-studio/tauri-plugin-holochain`, a repo whose availability has been
unreliable. If it becomes unfetchable, push a local clone of that repo (at the
pinned rev) to a HelloVolla-controlled remote and swap the `git` URL in
`src-tauri/Cargo.toml` — same rev, no other changes. A planned migration off
this dependency is documented in
`docs/superpowers/plans/2026-08-13-desktop-unified-plugin-migration.md`.

### Run on desktop

Expand Down
340 changes: 340 additions & 0 deletions docs/superpowers/plans/2026-08-13-desktop-unified-plugin-migration.md

Large diffs are not rendered by default.

142 changes: 5 additions & 137 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

159 changes: 141 additions & 18 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,34 +1,157 @@
{
description = "Template for Holochain app development";
description = "Volla Messages — development environment";

# We depend on holonix only for the Holochain toolchain (holochain, hc,
# lair-keystore, bootstrap-srv) and the rust-overlay it already pins.
# Everything else (Rust toolchain, Android SDK/NDK, Tauri desktop libs) is
# composed here from nixpkgs, so the repo has no dependency on any external
# Tauri/Holochain dev-shell flake. (The previous dev shells came from
# darksoil-studio/tauri-plugin-holochain, whose availability has been
# unreliable, and which pinned a stale webkitgtk 2.42.)
inputs = {
p2p-shipyard.url = "github:darksoil-studio/tauri-plugin-holochain/main-0.6.1";
p2p-shipyard.inputs.holonix.follows = "holonix";
holonix.url = "github:holochain/holonix/main-0.6";

nixpkgs.follows = "holonix/nixpkgs";
flake-parts.follows = "holonix/flake-parts";
rust-overlay.follows = "holonix/rust-overlay";
};

outputs = inputs @ { ... }:
inputs.holonix.inputs.flake-parts.lib.mkFlake { inherit inputs; }
{
outputs = inputs:
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
systems = builtins.attrNames inputs.holonix.devShells;
perSystem = { system, inputs', ... }:
let
pkgs = import inputs.nixpkgs {
inherit system;
overlays = [ (import inputs.rust-overlay) ];
config = {
allowUnfree = true; # Android SDK/NDK are unfree
android_sdk.accept_license = true;
};
};

perSystem =
{ inputs', pkgs, system, ...}: {
devShells.default = pkgs.mkShell {
inputsFrom = [
inputs'.holonix.devShells.default
inputs'.p2p-shipyard.devShells.holochainTauriDev
];
# Rust toolchain. Channel, components, and cross-compilation targets all
# come from ./rust-toolchain.toml so nix and rustup users stay in sync.
rust = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;

# Android SDK + NDK, matching the gradle configs in src-tauri/gen/*
# (compileSdk 35, targetSdk 34, minSdk 27). The NDK is what `cargo ndk`
# uses to cross-compile the Rust crates into jniLibs. 28.0.13004108 is
# the NDK the previous (darksoil) dev shell shipped, so produced .so
# files stay the same (clang 19, 16 KB page-aligned).
ndkVersion = "28.0.13004108";
androidComposition = pkgs.androidenv.composeAndroidPackages {
# 34 + 35: targetSdk and compileSdk. Gradle cannot auto-install
# platforms or build-tools into the read-only nix store, so every
# version the build touches must be listed here.
platformVersions = [ "34" "35" ];
buildToolsVersions = [ "34.0.0" "35.0.0" ];
includeNDK = true;
ndkVersions = [ ndkVersion ];
cmakeVersions = [ "3.22.1" ];
includeEmulator = false; # emulator is provided by CI / installed on demand
includeSystemImages = false;
};
androidSdk = androidComposition.androidsdk;
androidHome = "${androidSdk}/libexec/android-sdk";
ndkHome = "${androidHome}/ndk/${ndkVersion}";

# System libraries to build/run a Tauri v2 desktop app on Linux.
tauriDeps = with pkgs; [
webkitgtk_4_1
gtk3
gdk-pixbuf
glib
glib-networking
librsvg
libsoup_3
dbus
openssl
];

# Tools common to the desktop and android shells.
commonPackages = (with inputs'.holonix.packages; [
holochain
hc
lair-keystore
bootstrap-srv # `kitsune2-bootstrap-srv`, used by `npm run local-services`
]) ++ [
rust
] ++ (with pkgs; [
nodejs_22
cmake # aws-lc-sys (iroh/rustls crypto) builds its C sources with CMake
pkg-config
binaryen # wasm-opt, for building hApp/zome wasm
shared-mime-info
gsettings-desktop-schemas
]);

# Environment for building and running the Tauri desktop app with the
# nix-provided webkit. Shared verbatim by both shells.
desktopHook = ''
# getrandom 0.3 (in the zome dependency tree) refuses to build for
# wasm32-unknown-unknown unless a backend is chosen; zome wasm never
# calls OS randomness, so select the "custom" backend (same as the
# previous darksoil dev shell did).
export CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_RUSTFLAGS='--cfg getrandom_backend="custom"'

# TLS for the nix webkit (glib-networking's GIO module). Additive on
# purpose: GIO_MODULE_DIR would override the module search path for
# every GLib app launched from this shell.
export GIO_EXTRA_MODULES=${pkgs.glib-networking}/lib/gio/modules
# webkitgtk >= 2.44 requires a working EGL display in its web process
# (DMA-BUF renderer + Skia) and aborts with EGL_BAD_PARAMETER without
# one. nixpkgs' libglvnd only searches /run/opengl-driver for EGL
# vendor drivers — a NixOS-only path — so on other distros the nix
# dev shell finds no GPU driver and the webview dies blank. Supply a
# vendor list: the host's native drivers first (host binaries run
# from this shell behave exactly as outside it), then nixpkgs Mesa,
# which nix-linked binaries fall back to (llvmpipe on NVIDIA;
# can drive AMD/Intel GPUs directly) after failing to dlopen the
# host's driver. NixOS hosts skip this and keep /run/opengl-driver.
if [ ! -e /run/opengl-driver ] && [ -z "$__EGL_VENDOR_LIBRARY_FILENAMES" ] && [ -z "$__EGL_VENDOR_LIBRARY_DIRS" ]; then
export __EGL_VENDOR_LIBRARY_DIRS=/etc/glvnd/egl_vendor.d:/usr/share/glvnd/egl_vendor.d:${pkgs.mesa}/share/glvnd/egl_vendor.d
fi
# GTK schema lookup for the nix webkit; GSETTINGS_SCHEMAS_PATH is
# filled by the glib setup hook from the schemas in `packages`.
export XDG_DATA_DIRS=$GSETTINGS_SCHEMAS_PATH:$XDG_DATA_DIRS
'';
in
{
devShells.default = pkgs.mkShell {
packages = commonPackages;
buildInputs = tauriDeps;
shellHook = desktopHook + ''
export PS1='\[\033[1;35m\][volla-dev:\w]\$\[\033[0m\] '
'';
};

devShells.androidDev = pkgs.mkShell {
inputsFrom = [
inputs'.p2p-shipyard.devShells.holochainTauriAndroidDev
inputs'.holonix.devShells.default
];
packages = commonPackages ++ [ androidSdk ] ++ (with pkgs; [
cargo-ndk # build Rust -> Android jniLibs
jdk17 # Gradle
]);
buildInputs = tauriDeps;
shellHook = desktopHook + ''
export ANDROID_HOME="${androidHome}"
export ANDROID_SDK_ROOT="${androidHome}"
export ANDROID_NDK="${ndkHome}"
export ANDROID_NDK_ROOT="${ndkHome}"
export ANDROID_NDK_HOME="${ndkHome}"
export NDK_HOME="${ndkHome}"

# cargo-ndk exports plain CC/CXX/AR pointing at the NDK clang, which
# also hijacks *host* compiles (build scripts, proc-macro deps). The
# HOST_* variants take precedence in the `cc` crate for host-targeted
# units, so host builds keep the host toolchain even under
# `cargo ndk`.
export HOST_CC=gcc
export HOST_CXX=g++
export HOST_AR=ar

export PS1='\[\033[1;35m\][volla-android:\w]\$\[\033[0m\] '
'';
};
};
};
}
}
16 changes: 16 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[toolchain]
# 1.89.0 matches the toolchain the release workflows install; the nix dev
# shell derives its rust from this file (rust-overlay), so nix, rustup, and
# CI users all build with the same compiler.
channel = "1.89.0"
components = ["rustfmt", "clippy"]
profile = "minimal"
targets = [
# zome wasm (npm run build:zomes)
"wasm32-unknown-unknown",
# android (npm run tauri:android:build:*)
"aarch64-linux-android",
"armv7-linux-androideabi",
"i686-linux-android",
"x86_64-linux-android",
]
Loading
Loading