{ lib , fetchFromGitHub , rustPlatform , pkg-config , wrapGAppsHook3 , llvmPackages , binaryen , tailwindcss_3 , webkitgtk_4_1 , gtk3 , glib , cairo , gdk-pixbuf , pango , atk , libsoup_3 , librsvg , dbus , openssl , at-spi2-atk , at-spi2-core , glib-networking , gsettings-desktop-schemas , wasm-bindgen-cli , trunk , makeWrapper , libayatana-appindicator }: let pname = "pinepods"; version = "0.8.2"; src = fetchFromGitHub { owner = "madeofpendletonwool"; repo = "PinePods"; rev = version; sha256 = "1ivqazhzg3wwlqzz0dv0g48hv265c3qqhvxl02j20361j4mqn6rp"; }; # ── Step 1: Build the Yew/WASM frontend with trunk ────────────────────────── frontend = rustPlatform.buildRustPackage { pname = "pinepods-frontend"; inherit version src; sourceRoot = "source/web"; cargoRoot = "."; cargoLock = { lockFile = ./Cargo.frontend.lock; outputHashes = { "i18nrs-0.1.7" = "sha256-LEHQ8GI3eVKwhtxetxyIY4HV16TS3D9n+2Hh+sm5j74="; }; }; nativeBuildInputs = [ trunk wasm-bindgen-cli llvmPackages.lld binaryen tailwindcss_3 ]; buildPhase = '' cp -r . $NIX_BUILD_TOP/web-build chmod -R u+w $NIX_BUILD_TOP/web-build cd $NIX_BUILD_TOP/web-build mkdir -p dist export HOME=$NIX_BUILD_TOP export XDG_CACHE_HOME=$NIX_BUILD_TOP/cache mkdir -p $NIX_BUILD_TOP/cache export TRUNK_SKIP_VERSION_CHECK=true export TRUNK_TOOLS_WASM_BINDGEN=0.2.105 export TRUNK_TOOLS_WASM_OPT=version_124 RUSTFLAGS="--cfg=web_sys_unstable_apis" trunk build --release ''; installPhase = '' cp -r $NIX_BUILD_TOP/web-build/dist $out ''; doCheck = false; }; in # ── Step 2: Build the Tauri binary, pointing it at the pre-built frontend ──── rustPlatform.buildRustPackage { inherit pname version src; sourceRoot = "source/web/src-tauri"; cargoRoot = "."; cargoExtraArgs = "--bin app"; cargoLock = { lockFile = ./Cargo.lock; }; nativeBuildInputs = [ pkg-config wrapGAppsHook3 makeWrapper ]; buildInputs = [ openssl dbus glib gtk3 cairo gdk-pixbuf pango atk at-spi2-atk at-spi2-core libsoup_3 webkitgtk_4_1 librsvg glib-networking gsettings-desktop-schemas libayatana-appindicator ]; OPENSSL_NO_VENDOR = "1"; TAURI_SKIP_DEVSERVER_CHECK = "true"; preBuild = '' chmod -R u+w $NIX_BUILD_TOP/source ln -s ${frontend} $NIX_BUILD_TOP/source/web/dist ''; installPhase = '' runHook preInstall install -Dm755 target/x86_64-unknown-linux-gnu/release/app $out/bin/pinepods if [ -f ../../pinepods.desktop ]; then install -Dm644 ../../pinepods.desktop $out/share/applications/pinepods.desktop fi for size in 32x32 64x64 128x128 256x256; do if [ -f icons/''${size}.png ]; then install -Dm644 icons/''${size}.png \ $out/share/icons/hicolor/''${size}/apps/pinepods.png fi done runHook postInstall ''; postFixup = '' wrapProgram $out/bin/pinepods \ --set WEBKIT_DISABLE_COMPOSITING_MODE 1 \ --prefix LD_LIBRARY_PATH : "${libayatana-appindicator}/lib" \ --prefix XDG_DATA_DIRS : "${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name}:${gtk3}/share/gsettings-schemas/${gtk3.name}" \ --prefix GIO_EXTRA_MODULES : "${glib-networking}/lib/gio/modules" ''; doCheck = false; meta = with lib; { description = "PinePods desktop client - self-hosted podcast manager (Tauri v2)"; homepage = "https://github.com/madeofpendletonwool/PinePods"; license = licenses.gpl3Only; platforms = platforms.linux; mainProgram = "pinepods"; }; }