Jump to content

Tauri: Difference between revisions

From Official NixOS Wiki
m Shell & Building Docs Cleanup
m Rename building with nixpkgs to `cargo-tauri.hook`
 
Line 29: Line 29:
}</syntaxhighlight>
}</syntaxhighlight>


== Building a Tauri app on nixpkgs? ==
== Building a Tauri app with <code>cargo-tauri.hook</code> ==
A distribution mechanism has been implemented for Tauri applications within Nixpkgs. Refer to the [https://nixos.org/manual/nixpkgs/unstable/#tauri-hook <code>cargo-tauri.hook</code> Nixpkgs Documentation] for implementation details.
A distribution mechanism has been implemented for Tauri applications within Nixpkgs. Refer to the [https://nixos.org/manual/nixpkgs/unstable/#tauri-hook <code>cargo-tauri.hook</code> Nixpkgs Documentation] for implementation details.



Latest revision as of 15:07, 14 November 2026

⚠︎
Warning: Work in Progress

Development environment with nix-shell

References

# Run with `nix-shell shell.nix`
{ pkgs ? import <nixpkgs> { } }:
pkgs.mkShell {
  nativeBuildInputs = with pkgs; [
    pkg-config
    wrapGAppsHook4
    cargo 
    cargo-tauri # Optional, Only needed if Tauri doesn't work through the traditional way.
    nodejs # Optional, this is for if you have a js frontend
    rustc # Needed for dev server (npm tauri dev)
    gst_all_1.gst-plugins-base # Optional, if you get `GStreamer element appsink not found. Please install it.`
  ];

  buildInputs = with pkgs; [
    librsvg
    webkitgtk_4_1
  ];

  shellHook = ''
    export XDG_DATA_DIRS="$GSETTINGS_SCHEMAS_PATH" # Needed on Wayland to report the correct display scale
  '';
}

Building a Tauri app with cargo-tauri.hook

A distribution mechanism has been implemented for Tauri applications within Nixpkgs. Refer to the cargo-tauri.hook Nixpkgs Documentation for implementation details.

Building a Tauri app with crane

The crane-tauri flake uses crane to cache cargoArtifacts, so changes to your app source rebuild at near-incremental speed. Refer to the source code repository for implementation details and documentation.