Tauri: Difference between revisions
Appearance
m Fixing code submitted on last edit |
m I found this line in my logs. Installing gst-plugins-base fixed the issue. |
||
| (7 intermediate revisions by 6 users not shown) | |||
| Line 6: | Line 6: | ||
* [[Development environment with nix-shell|https://wiki.nixos.org/wiki/Development_environment_with_nix-shell]] (2025-01-23) | * [[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) | * https://v2.tauri.app/start/prerequisites/ (2025-01-23) | ||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix"># Run with `nix-shell shell.nix` | ||
# Run with `nix-shell shell.nix` | |||
let | let | ||
pkgs = import <nixpkgs> { }; | pkgs = import <nixpkgs> { }; | ||
| Line 14: | Line 13: | ||
nativeBuildInputs = with pkgs; [ | nativeBuildInputs = with pkgs; [ | ||
pkg-config | pkg-config | ||
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 | ||
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;[ | buildInputs = with pkgs; [ | ||
librsvg | librsvg | ||
webkitgtk_4_1 | webkitgtk_4_1 | ||
]; | ]; | ||
</syntaxhighlight> | 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? == | ||
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] | |||
== Building a Tauri app with crane == | |||
The [https://github.com/JPHutchins/crane-tauri crane-tauri] flake uses [https://github.com/ipetkov/crane crane] to cache <code>cargoArtifacts</code>, so changes to your app source rebuild at near-incremental speed. Refer to the [https://github.com/JPHutchins/crane-tauri source code repository] for implementation details and documentation. | |||
[[Category:Development]] | |||
Latest revision as of 12:47, 8 September 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
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 on nixpkgs?
A distribution mechanism has been implemented for Tauri applications within Nixpkgs. Refer to the Nixpkgs documentation for implementation details. here
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.