Tauri: Difference between revisions

Almino (talk | contribs)
Adding nix-shell dev env
Simplified buildInputs and added a shellHook for wayland environments
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{warning | Work in Progress}}
{{warning | Work in Progress}}


{{file|shell.nix|nix|
== Development environment with <code>nix-shell</code> ==
References
 
* [[Development environment with nix-shell|https://wiki.nixos.org/wiki/Development_environment_with_nix-shell]] (2025-01-23)
* https://v2.tauri.app/start/prerequisites/ (2025-01-23)
<syntaxhighlight lang="nix">
# Run with `nix-shell shell.nix`
let
let
   pkgs = import <nixpkgs> { };
   pkgs = import <nixpkgs> { };
Line 8: Line 14:
   nativeBuildInputs = with pkgs; [
   nativeBuildInputs = with pkgs; [
     pkg-config
     pkg-config
     gobject-introspection
     wrapGAppsHook4
     cargo
     cargo  
     cargo-tauri
     cargo-tauri # Optional, Only needed if Tauri doesn't work through the traditional way.
     nodejs
     nodejs # Optional, this is for if you have a js frontend
   ];
   ];


   buildInputs = with pkgs;[
   buildInputs = with pkgs; [
    at-spi2-atk
    atkmm
    cairo
    gdk-pixbuf
    glib
    gtk3
    harfbuzz
     librsvg
     librsvg
    libsoup_3
    pango
     webkitgtk_4_1
     webkitgtk_4_1
    openssl
   ];
   ];
  shellHook = "
    export XDG_DATA_DIRS="$GSETTINGS_SCHEMAS_PATH" # Needed on Wayland to report the correct display scale
  ";
}
}
}}


</syntaxhighlight>


== Building a Tauri app on nixpkgs? ==
== Building a Tauri app on nixpkgs? ==
An official hook has been developed to help you distribute your Tauri app.
A distribution mechanism has been implemented for Tauri applications within Nixpkgs. Refer to the Nixpkgs documentation for implementation details. [https://nixos.org/manual/nixpkgs/unstable/#tauri-hook here]
For more info please checkout the Nixpkgs reference manual [https://nixos.org/manual/nixpkgs/unstable/#tauri-hook here]
 
[[Category:Development]]