#NixOS, Tauri desktop build fails. `/usr/bin/xdg-open` not found

2 messages · Page 1 of 1 (latest)

solemn eagle
#

On nixos trying to build tauri for desktop using cargo tauri build fails because it cannot find /usr/bin/xdg-open. xdg-open is in a different path in nixos due to the filesystem but it is still accessible in the PATH.

shell.nix for reference

# shell.nix for Rust
{
  pkgs ? import <nixpkgs> { },
}:

pkgs.mkShell {
  name = "JetS";
  nativeBuildInputs = with pkgs; [
    pkg-config
    gobject-introspection
    rust-analyzer
    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
    pnpm
  ];

  buildInputs = with pkgs;[
    at-spi2-atk
    atkmm
    cairo
    gdk-pixbuf
    glib
    gtk3
    harfbuzz
    librsvg
    libsoup_3
    pango
    webkitgtk_4_1
    openssl
  ];

  RUST_BACKTRACE = 1;
}

north carbon
#

as a workaround you can add xdg-open via the files config(s) in tauri.conf.json (or maybe the externalBin config)