Skip to content

Building from Source

temidaradev edited this page Nov 30, 2026 · 3 revisions

Dependencies

Using Nix

Tip

Nix is the primary means of development for Kopuz, and it is the recommended method for getting build dependencies in a pure, reproducible environment consistent across systems.

# Using Nix3 CLI
nix develop

If you are a Direnv user, use the provided .envrc:

# Using Direnv
direnv allow

Direnv is recommended if you want to keep using your usershell within the development environment.

Note

The system tray icon (used by minimize to tray) requires the appindicator library at runtime. It is included in the package dependencies below. Without it the tray icon simply won't appear and closing the window quits the app instead of hiding it - Kopuz still runs normally. The Nix dev shell already provides it.

Arch Linux Based Systems

sudo pacman -S rust cargo dioxus-cli base-devel cmake pkgconf opus alsa-lib xdotool webkit2gtk-4.1 gtk3 libsoup3 openssl libayatana-appindicator

Debian Based Systems

sudo apt install rustc cargo build-essential cmake pkg-config libopus-dev libasound2-dev libxdo-dev libwebkit2gtk-4.1-dev libgtk-3-dev libsoup-3.0-dev libssl-dev libayatana-appindicator3-1
cargo install dioxus-cli

Fedora Based Systems

sudo dnf groupinstall "Development Tools" "Development Libraries"
sudo dnf install rust cargo cmake pkgconf-pkg-config opus-devel alsa-lib-devel libxdo-devel webkit2gtk4.1-devel gtk3-devel libsoup3-devel openssl-devel libayatana-appindicator-gtk3
cargo install --locked dioxus-cli

openSUSE Based Systems

sudo zypper install rust cargo cmake pkg-config libopus-devel alsa-devel xdotool webkit2gtk3-soup2-devel gtk3-devel libsoup3-devel libopenssl-devel libayatana-appindicator3-1
cargo install --locked dioxus-cli

Repositories and releases

Kopuz lives in three repositories:

Repository What it holds
kopuz kopuzd, kopuzctl, the shared crates both apps build against, packaging and releases
kopuz-gpui The GPUI app, desktop and Android, as the apps/kopuz submodule
kopuz-legacy The Dioxus app, as the apps/legacy submodule

A change to an app is a pull request in its own repository, built and checked there against kopuz master. It ships once kopuz's submodule points at it: commit the new submodule commit in kopuz.

Kopuz has one version, the one in this repository's Cargo.toml. The apps say 0.0.0 and never carry their own. A tag on kopuz builds and publishes every package, as before: scripts/pin-frontend.sh builds each app against the tagged kopuz and stamps its version into it, and the release attaches a source tarball with the submodules, which the AUR source packages and the Nix packages build from.

kopuz follows the apps on its own: every hour, and before every nightly, the Sync apps workflow moves both submodules (and flake.lock) to their latest master once they build against kopuz. A nightly therefore always has the current apps, and a release ships whatever they were when you bumped the version.

Developing Kopuz

Clone the repository with its submodules and start the legacy app on a debug daemon of its own:

git clone --recurse-submodules https://github.com/Kopuz-org/kopuz
cd kopuz
(cd apps/legacy && npm ci)
just serve

After a pull that moves a submodule, run git submodule update --init --recursive. just gpui run builds and starts the GPUI app the same way, and just daemon runs the headless daemon. Inside an app's own checkout, its justfile finds kopuz beside it (or in KOPUZ_DIR) and builds against it.

Debug builds use a separate kopuz-debug.db. Set KOPUZ_DB_PATH to override its location.

Build release packages with just build. Cargo manifests and Cargo.lock are the dependency source of truth for all workspace crates; each app has its own Cargo.lock in its repository.

Run tests, lint both build profiles, and check formatting:

SQLX_OFFLINE=true cargo test --workspace --locked
SQLX_OFFLINE=true cargo clippy --workspace --all-targets -- -D warnings
SQLX_OFFLINE=true cargo clippy --workspace --all-targets --release -- -D warnings
cargo fmt --all -- --check

Tailwind output is committed because Dioxus consumes it as an application asset. Regenerate it whenever UI classes change:

cd apps/legacy
npm ci
just tailwind

Dioxus also bundles the legacy app's desktop installers with just build.

Clone this wiki locally