Jump to content

Tauri: Difference between revisions

From Official NixOS Wiki
m added a comment for optional dependancies
Mrid22 (talk | contribs)
m i added rustc as a package in the devshell, as its needed to run the dev server that tauri provides
 
(4 intermediate revisions by 4 users not shown)
Line 14: Line 14:
   nativeBuildInputs = with pkgs; [
   nativeBuildInputs = with pkgs; [
     pkg-config
     pkg-config
     gobject-introspection
     wrapGAppsHook4
     cargo  
     cargo  
     cargo-tauri # Optional, Only needed if Tauri doesn't work through the traditional way.
     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
     nodejs # Optional, this is for if you have a js frontend
    rustc # Needed for dev server (npm tauri dev)
   ];
   ];


   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 = "";
 
   shellHook = ''
    export XDG_DATA_DIRS="$GSETTINGS_SCHEMAS_PATH" # Needed on Wayland to report the correct display scale
  '';
}
}


Line 40: Line 34:


== 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]]

Latest revision as of 07:59, 24 March 2026

⚠︎
Warning: Work in Progress

Development environment with nix-shell

References

# Run with `nix-shell shell.nix`
let
  pkgs = import <nixpkgs> { };
in
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)
  ];

  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 on nixpkgs?

A distribution mechanism has been implemented for Tauri applications within Nixpkgs. Refer to the Nixpkgs documentation for implementation details. here