Tauri: Difference between revisions
Appearance
Eveeifyeve (talk | contribs) Documentation for tauri on Nix |
Simplified buildInputs and added a shellHook for wayland environments |
||
| (7 intermediate revisions by 3 users not shown) | |||
| Line 1: | Line 1: | ||
{{warning | | {{warning | Work in Progress}} | ||
== 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"> | <syntaxhighlight lang="nix"> | ||
# Run with `nix-shell shell.nix` | |||
let | let | ||
pkgs = import <nixpkgs> { }; | |||
in | 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 | |||
]; | |||
buildInputs = with pkgs; [ | |||
librsvg | |||
webkitgtk_4_1 | |||
]; | |||
shellHook = " | |||
export XDG_DATA_DIRS="$GSETTINGS_SCHEMAS_PATH" # Needed on Wayland to report the correct display scale | |||
"; | |||
} | |||
</syntaxhighlight> | </syntaxhighlight> | ||
== 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. [https://nixos.org/manual/nixpkgs/unstable/#tauri-hook here] | |||
[[Category:Development]] | |||
Latest revision as of 00:34, 11 February 2026
⚠︎
Warning: Work in Progress
Development environment with nix-shell
References
- https://wiki.nixos.org/wiki/Development_environment_with_nix-shell (2025-01-23)
- https://v2.tauri.app/start/prerequisites/ (2025-01-23)
# 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
];
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