13 pkgDescription = "All-in-one tool for managing Nintendo Switch homebrew";
16 attrs.${stdenv.hostPlatform.system}
17 or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
19 jreWithJavaFX = jre.override { enableJavaFX = true; };
21 maven.buildMavenPackage rec {
22 pname = "ns-usbloader";
25 src = fetchFromGitHub {
26 owner = "developersu";
27 repo = "ns-usbloader";
29 sha256 = "sha256-gSf5SCIhcUEYGsYssXVGjUweVU+guxOI+lzD3ANr96w=";
32 patches = [ ./no-launch4j.patch ./make-deterministic.patch ];
34 # JavaFX pulls in architecture dependent jar dependencies. :(
35 # May be possible to unify these, but could lead to huge closure sizes.
36 mvnHash = selectSystem {
37 x86_64-linux = "sha256-vXZAlZOh9pXNF1RL78oQRal5pkXFRKDz/7SP9LibgiA=";
38 aarch64-linux = "sha256-xC+feb41EPi30gBrVR8usanVULI2Pt0knztzNagPQiw=";
50 # Don't wrap binaries twice.
54 # * Set us to only use software rendering with `-Dprism.order=sw`, had a hard time
55 # getting `prism_es2` happy with NixOS's GL/GLES.
56 # * Currently, there's also a lot of `Failed to build parent project for org.openjfx:javafx-*`
57 # at build, but jar runs fine when using `jreWithJavaFX`.
62 mkdir -p $out/share/java
63 install -Dm644 target/ns-usbloader-${version}.jar $out/share/java/ns-usbloader.jar
65 mkdir -p $out/lib/udev/rules.d
66 install -Dm644 ${./99-ns-usbloader.rules} $out/lib/udev/rules.d/99-ns-usbloader.rules
68 mkdir -p $out/share/icons/hicolor
69 install -Dm644 target/classes/res/app_icon32x32.png $out/share/icons/hicolor/32x32/apps/ns-usbloader.png
70 install -Dm644 target/classes/res/app_icon48x48.png $out/share/icons/hicolor/48x48/apps/ns-usbloader.png
71 install -Dm644 target/classes/res/app_icon64x64.png $out/share/icons/hicolor/64x64/apps/ns-usbloader.png
72 install -Dm644 target/classes/res/app_icon128x128.png $out/share/icons/hicolor/128x128/apps/ns-usbloader.png
79 makeWrapper ${jreWithJavaFX}/bin/java $out/bin/ns-usbloader \
80 --append-flags "-Dprism.order=sw -jar $out/share/java/ns-usbloader.jar" \
81 "''${gappsWrapperArgs[@]}"
87 name = "ns-usbloader";
88 desktopName = "NS-USBLoader";
89 comment = pkgDescription;
90 exec = "ns-usbloader";
91 icon = "ns-usbloader";
92 categories = [ "Game" ];
94 keywords = [ "nintendo" "switch" ];
99 description = pkgDescription;
100 homepage = "https://github.com/developersu/ns-usbloader";
101 license = licenses.gpl3Only;
102 maintainers = with maintainers; [ soupglasses ];
103 platforms = [ "x86_64-linux" "aarch64-linux" ];
104 mainProgram = "ns-usbloader";