{ lib, fetchFromGitHub, rustPlatform, cargo-tauri, nodejs, npmHooks, fetchNpmDeps, pkg-config, wrapGAppsHook3, openssl, webkitgtk_4_1, glib-networking, libappindicator, nix-update-script, }: rustPlatform.buildRustPackage (finalAttrs: { pname = "rclone-ui"; version = "3.7.2"; src = fetchFromGitHub { owner = "rclone-ui"; repo = "rclone-ui"; tag = "v${finalAttrs.version}"; hash = "sha256-H/4qU1FJ+EHSdXB0DH8YrfUa8sKfXOGnwOZrQeQfLYI="; }; npmDeps = fetchNpmDeps { name = "${finalAttrs.pname}-${finalAttrs.version}-npm-deps"; inherit (finalAttrs) src; forceGitDeps = true; hash = "sha256-i1czFB8EvS1KE8ukWp+02/K51FK/M9pabcNcbhtGWnM="; }; cargoRoot = "src-tauri"; buildAndTestSubdir = finalAttrs.cargoRoot; cargoHash = "sha256-KVrHpJsB8yMknWPxXE3F/SdIlMoRhqFWmxdKe/HIIxE="; # Disable tauri bundle updater, can be removed when #389107 is merged patches = [ ./remove_updater.patch ]; postPatch = '' substituteInPlace src-tauri/tauri.conf.json \ --replace-fail '"mainBinaryName": "Rclone UI"' '"mainBinaryName": "${finalAttrs.meta.mainProgram}"' substituteInPlace src-tauri/Cargo.toml \ --replace-fail 'name = "app"' 'name = "${finalAttrs.pname}"' ''; nativeBuildInputs = [ npmHooks.npmConfigHook nodejs cargo-tauri.hook pkg-config wrapGAppsHook3 ]; buildInputs = [ openssl webkitgtk_4_1 glib-networking libappindicator ]; dontWrapGApps = true; postInstall = '' wrapProgram $out/bin/rclone-ui \ --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ libappindicator ]} ''; checkFlags = [ # don't have internet access "--skip=notifications::webhooks::tests::dispatch_posts_and_records_outcomes_end_to_end" "--skip=notifications::webhooks::tests::dispatch_records_last_error_on_unreachable_endpoint" ]; passthru.updateScript = nix-update-script { }; meta = { description = "Cross-platform desktop GUI for rclone & S3"; homepage = "https://github.com/rclone-ui/rclone-ui"; downloadPage = "https://github.com/rclone-ui/rclone-ui"; changelog = "https://github.com/rclone-ui/rclone-ui/releases/tag/v${finalAttrs.version}"; license = lib.licenses.asl20; maintainers = with lib.maintainers; [ genga898 ]; mainProgram = "rclone-ui"; }; })