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=";
40 mvnParameters = "-DskipTests";
49 # Don't wrap binaries twice.
53 # * Set us to only use software rendering with `-Dprism.order=sw`, had a hard time
54 # getting `prism_es2` happy with NixOS's GL/GLES.
55 # * Currently, there's also a lot of `Failed to build parent project for org.openjfx:javafx-*`
56 # at build, but jar runs fine when using `jreWithJavaFX`.
61 mkdir -p $out/share/java
62 install -Dm644 target/ns-usbloader-${version}.jar $out/share/java/ns-usbloader.jar
64 mkdir -p $out/lib/udev/rules.d
65 install -Dm644 ${./99-ns-usbloader.rules} $out/lib/udev/rules.d/99-ns-usbloader.rules
67 mkdir -p $out/share/icons/hicolor
68 install -Dm644 target/classes/res/app_icon32x32.png $out/share/icons/hicolor/32x32/apps/ns-usbloader.png
69 install -Dm644 target/classes/res/app_icon48x48.png $out/share/icons/hicolor/48x48/apps/ns-usbloader.png
70 install -Dm644 target/classes/res/app_icon64x64.png $out/share/icons/hicolor/64x64/apps/ns-usbloader.png
71 install -Dm644 target/classes/res/app_icon128x128.png $out/share/icons/hicolor/128x128/apps/ns-usbloader.png
78 makeWrapper ${jreWithJavaFX}/bin/java $out/bin/ns-usbloader \
79 --append-flags "-Dprism.order=sw -jar $out/share/java/ns-usbloader.jar" \
80 "''${gappsWrapperArgs[@]}"
86 name = "ns-usbloader";
87 desktopName = "NS-USBLoader";
88 comment = pkgDescription;
89 exec = "ns-usbloader";
90 icon = "ns-usbloader";
91 categories = [ "Game" ];
93 keywords = [ "nintendo" "switch" ];
98 description = pkgDescription;
99 homepage = "https://github.com/developersu/ns-usbloader";
100 license = licenses.gpl3Only;
101 maintainers = with maintainers; [ soupglasses ];
102 platforms = [ "x86_64-linux" "aarch64-linux" ];
103 mainProgram = "ns-usbloader";