1 # cargo-tauri.hook {#tauri-hook}
3 [Tauri](https://tauri.app/) is a framework for building smaller, faster, and
4 more secure desktop applications with a web frontend.
6 In Nixpkgs, `cargo-tauri.hook` overrides the default build and install phases.
8 ## Example code snippet {#tauri-hook-example-code-snippet}
26 rustPlatform.buildRustPackage rec {
31 # Assuming our app's frontend uses `npm` as a package manager
32 npmDeps = fetchNpmDeps {
33 name = "${pname}-npm-deps-${version}";
39 # Pull in our main hook
44 npmHooks.npmConfigHook
46 # Make sure we can find our libraries
53 ++ lib.optionals stdenv.hostPlatform.isLinux [
54 glib-networking # Most Tauri apps need networking
58 # Set our Tauri source directory
59 cargoRoot = "src-tauri";
60 # And make sure we build there too
61 buildAndTestSubdir = cargoRoot;
67 ## Variables controlling cargo-tauri {#tauri-hook-variables-controlling}
69 ### Tauri Exclusive Variables {#tauri-hook-exclusive-variables}
71 #### `tauriBuildFlags` {#tauri-build-flags}
73 Controls the flags passed to `cargo tauri build`.
75 #### `tauriBundleType` {#tauri-bundle-type}
77 The [bundle type](https://tauri.app/v1/guides/building/) to build.
79 #### `dontTauriBuild` {#dont-tauri-build}
81 Disables using `tauriBuildHook`.
83 #### `dontTauriInstall` {#dont-tauri-install}
85 Disables using `tauriInstallPostBuildHook` and `tauriInstallHook`.
87 ### Honored Variables {#tauri-hook-honored-variables}
89 Along with those found in [](#compiling-rust-applications-with-cargo), the
90 following variables used by `cargoBuildHook` and `cargoInstallHook` are honored
91 by the cargo-tauri setup hook.
93 - `buildAndTestSubdir`
95 - `cargoBuildNoDefaultFeatures`
96 - `cargoBuildFeatures`