diff --git a/pkgs/by-name/il/iloader/disable-update.patch b/pkgs/by-name/il/iloader/disable-update.patch new file mode 100644 index 000000000000..3eec01d44282 --- /dev/null +++ b/pkgs/by-name/il/iloader/disable-update.patch @@ -0,0 +1,20 @@ +--- a/src/App.tsx ++++ b/src/App.tsx +@@ -22,7 +22,7 @@ import { AppIds } from "./pages/AppIds"; + import { Settings } from "./pages/Settings"; + import { Pairing } from "./pages/Pairing"; + import { getVersion } from "@tauri-apps/api/app"; +-import { checkForUpdates } from "./update"; ++// import { checkForUpdates } from "./update"; + import logo from "./iloader.svg"; + import { GlassCard } from "./components/GlassCard"; + import { useTranslation } from "react-i18next"; +@@ -70,7 +70,7 @@ function App() { + }, []); + + useEffect(() => { +- checkForUpdates(); ++ // checkForUpdates(); + }, []); + + useEffect(() => { \ No newline at end of file diff --git a/pkgs/by-name/il/iloader/package.nix b/pkgs/by-name/il/iloader/package.nix new file mode 100644 index 000000000000..6d6b87d5ad00 --- /dev/null +++ b/pkgs/by-name/il/iloader/package.nix @@ -0,0 +1,129 @@ +{ + lib, + stdenv, + fetchFromGitHub, + + rustPlatform, + nodejs, + cargo-tauri, + bun, + writableTmpDirAsHomeHook, + + glib, + glib-networking, + gst_all_1, + openssl, + pkg-config, + webkitgtk_4_1, + wrapGAppsHook3, + makeWrapper, +}: +rustPlatform.buildRustPackage (finalAttrs: { + __structuredAttrs = true; + + pname = "iloader"; + version = "2.2.6"; + + src = fetchFromGitHub { + owner = "nab138"; + repo = "iloader"; + rev = "v${finalAttrs.version}"; + sha256 = "sha256-zSl08bhJ/OrdcvvL1ciybxgnLqrg4IinmcGXrsPQYyQ="; + }; + + nodeModules = stdenv.mkDerivation { + pname = "${finalAttrs.pname}-node_modules"; + inherit (finalAttrs) src version; + + nativeBuildInputs = [ + bun + writableTmpDirAsHomeHook + ]; + + dontConfigure = true; + + buildPhase = '' + runHook preBuild + + bun install \ + --cpu="*" \ + --frozen-lockfile \ + --ignore-scripts \ + --no-progress \ + --os="*" + + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + + mkdir -p $out + cp -r node_modules $out/node_modules + + runHook postInstall + ''; + + outputHash = "sha256-zB0BJrQuoIu7Y67WMfrVRsPPnJ6mhd5srL2M3zW6+1Q="; + outputHashAlgo = "sha256"; + outputHashMode = "recursive"; + }; + + cargoRoot = "src-tauri"; + buildAndTestSubdir = "src-tauri"; + cargoHash = "sha256-6nDqIikItl5SuHN2o/iQREiOkY+bYkP7akShOEtY9JY="; + + doCheck = false; + + patches = [ ./disable-update.patch ]; + + postPatch = '' + cp -r ${finalAttrs.nodeModules}/node_modules . + chmod -R +w node_modules + patchShebangs --build node_modules + ''; + + nativeBuildInputs = [ + bun + cargo-tauri.hook + nodejs + pkg-config + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ wrapGAppsHook3 ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ makeWrapper ]; + + buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ + gst_all_1.gstreamer + gst_all_1.gst-plugins-base + webkitgtk_4_1 + glib + glib-networking + openssl + ]; + + tauriBuildFlags = [ + "--config" + "ci.conf.json" + "--no-sign" + ]; + + postInstall = lib.optionalString stdenv.hostPlatform.isDarwin '' + mkdir -p $out/bin + makeWrapper $out/Applications/iloader.app/Contents/MacOS/iloader $out/bin/iloader + ''; + + meta = { + changelog = "https://github.com/nab138/iloader/releases/tag/v${finalAttrs.version}"; + description = "User friendly sideloader"; + homepage = "https://github.com/nab138/iloader"; + license = lib.licenses.mit; + mainProgram = "iloader"; + maintainers = with lib.maintainers; [ ern775 ]; + platforms = [ + "aarch64-linux" + "x86_64-linux" + "aarch64-darwin" + "x86_64-darwin" + ]; + }; +})