mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 13:40:28 +03:00
ns-usbloader: init at 7.0
This commit is contained in:
parent
00d7684ad8
commit
3273352d05
8 changed files with 316 additions and 0 deletions
|
@ -20,6 +20,8 @@
|
||||||
|
|
||||||
- [Typesense](https://github.com/typesense/typesense), a fast, typo-tolerant search engine for building delightful search experiences. Available as [services.typesense](#opt-services.typesense.enable).
|
- [Typesense](https://github.com/typesense/typesense), a fast, typo-tolerant search engine for building delightful search experiences. Available as [services.typesense](#opt-services.typesense.enable).
|
||||||
|
|
||||||
|
* [NS-USBLoader](https://github.com/developersu/ns-usbloader/), an all-in-one tool for managing Nintendo Switch homebrew. Available as [programs.ns-usbloader](#opt-programs.ns-usbloader.enable).
|
||||||
|
|
||||||
- [Anuko Time Tracker](https://github.com/anuko/timetracker), a simple, easy to use, open source time tracking system. Available as [services.anuko-time-tracker](#opt-services.anuko-time-tracker.enable).
|
- [Anuko Time Tracker](https://github.com/anuko/timetracker), a simple, easy to use, open source time tracking system. Available as [services.anuko-time-tracker](#opt-services.anuko-time-tracker.enable).
|
||||||
|
|
||||||
- [sitespeed-io](https://sitespeed.io), a tool that can generate metrics (timings, diagnostics) for websites. Available as [services.sitespeed-io](#opt-services.sitespeed-io.enable).
|
- [sitespeed-io](https://sitespeed.io), a tool that can generate metrics (timings, diagnostics) for websites. Available as [services.sitespeed-io](#opt-services.sitespeed-io.enable).
|
||||||
|
|
|
@ -221,6 +221,7 @@
|
||||||
./programs/nncp.nix
|
./programs/nncp.nix
|
||||||
./programs/noisetorch.nix
|
./programs/noisetorch.nix
|
||||||
./programs/npm.nix
|
./programs/npm.nix
|
||||||
|
./programs/ns-usbloader.nix
|
||||||
./programs/oblogout.nix
|
./programs/oblogout.nix
|
||||||
./programs/oddjobd.nix
|
./programs/oddjobd.nix
|
||||||
./programs/openvpn3.nix
|
./programs/openvpn3.nix
|
||||||
|
|
18
nixos/modules/programs/ns-usbloader.nix
Normal file
18
nixos/modules/programs/ns-usbloader.nix
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.programs.ns-usbloader;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options = {
|
||||||
|
programs.ns-usbloader = {
|
||||||
|
enable = lib.mkEnableOption (lib.mdDoc "ns-usbloader application with udev rules applied");
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
environment.systemPackages = [ pkgs.ns-usbloader ];
|
||||||
|
services.udev.packages = [ pkgs.ns-usbloader ];
|
||||||
|
};
|
||||||
|
|
||||||
|
meta.maintainers = pkgs.ns-usbloader.meta.maintainers;
|
||||||
|
}
|
|
@ -0,0 +1,4 @@
|
||||||
|
# Nintendo Switch HOS
|
||||||
|
SUBSYSTEM=="usb", ATTRS{idVendor}=="057e", ATTRS{idProduct}=="3000", MODE="0666"
|
||||||
|
# Nintendo Switch RCM
|
||||||
|
SUBSYSTEM=="usb", ATTRS{idVendor}=="0955", ATTRS{idProduct}=="7321", MODE="0666"
|
89
pkgs/applications/misc/ns-usbloader/default.nix
Normal file
89
pkgs/applications/misc/ns-usbloader/default.nix
Normal file
|
@ -0,0 +1,89 @@
|
||||||
|
{ lib
|
||||||
|
, stdenv
|
||||||
|
, fetchFromGitHub
|
||||||
|
, copyDesktopItems
|
||||||
|
, makeDesktopItem
|
||||||
|
, makeWrapper
|
||||||
|
, maven
|
||||||
|
, jre
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
pkgDescription = "All-in-one tool for managing Nintendo Switch homebrew";
|
||||||
|
|
||||||
|
selectSystem = attrs:
|
||||||
|
attrs.${stdenv.hostPlatform.system}
|
||||||
|
or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
|
||||||
|
|
||||||
|
jreWithJavaFX = jre.override { enableJavaFX = true; };
|
||||||
|
in
|
||||||
|
maven.buildMavenPackage rec {
|
||||||
|
pname = "ns-usbloader";
|
||||||
|
version = "7.0";
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "developersu";
|
||||||
|
repo = "ns-usbloader";
|
||||||
|
rev = "v${version}";
|
||||||
|
sha256 = "sha256-x4zGwsDUVUHI4AUMPSqgnZVyZx+pWQA5xvtrFE8U3QU=";
|
||||||
|
};
|
||||||
|
|
||||||
|
patches = [ ./no-launch4j.patch ./make-deterministic.patch ];
|
||||||
|
|
||||||
|
# JavaFX pulls in architecture dependent jar dependencies. :(
|
||||||
|
# May be possible to unify these, but could lead to huge closure sizes.
|
||||||
|
mvnHash = selectSystem {
|
||||||
|
x86_64-linux = "sha256-vXZAlZOh9pXNF1RL78oQRal5pkXFRKDz/7SP9LibgiA=";
|
||||||
|
aarch64-linux = "sha256-xC+feb41EPi30gBrVR8usanVULI2Pt0knztzNagPQiw=";
|
||||||
|
};
|
||||||
|
mvnParameters = "-DskipTests";
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
copyDesktopItems
|
||||||
|
maven
|
||||||
|
makeWrapper
|
||||||
|
];
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
|
||||||
|
mkdir -p $out/share/java
|
||||||
|
install -Dm644 target/ns-usbloader-${version}.jar $out/share/java/ns-usbloader.jar
|
||||||
|
|
||||||
|
mkdir -p $out/bin
|
||||||
|
makeWrapper ${jreWithJavaFX}/bin/java $out/bin/ns-usbloader \
|
||||||
|
--append-flags "-jar $out/share/java/ns-usbloader.jar"
|
||||||
|
|
||||||
|
mkdir -p $out/lib/udev/rules.d
|
||||||
|
install -Dm644 ${./99-ns-usbloader.rules} $out/lib/udev/rules.d/99-ns-usbloader.rules
|
||||||
|
|
||||||
|
mkdir -p $out/share/icons/hicolor
|
||||||
|
install -Dm644 target/classes/res/app_icon32x32.png $out/share/icons/hicolor/32x32/apps/ns-usbloader.png
|
||||||
|
install -Dm644 target/classes/res/app_icon48x48.png $out/share/icons/hicolor/48x48/apps/ns-usbloader.png
|
||||||
|
install -Dm644 target/classes/res/app_icon64x64.png $out/share/icons/hicolor/64x64/apps/ns-usbloader.png
|
||||||
|
install -Dm644 target/classes/res/app_icon128x128.png $out/share/icons/hicolor/128x128/apps/ns-usbloader.png
|
||||||
|
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
|
||||||
|
desktopItems = [
|
||||||
|
(makeDesktopItem {
|
||||||
|
type = "Application";
|
||||||
|
name = "ns-usbloader";
|
||||||
|
desktopName = "NS-USBLoader";
|
||||||
|
comment = pkgDescription;
|
||||||
|
exec = "ns-usbloader";
|
||||||
|
icon = "ns-usbloader";
|
||||||
|
categories = [ "Game" ];
|
||||||
|
terminal = false;
|
||||||
|
keywords = [ "nintendo" "switch" ];
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
description = pkgDescription;
|
||||||
|
homepage = "https://github.com/developersu/ns-usbloader";
|
||||||
|
license = licenses.gpl3Only;
|
||||||
|
maintainers = with maintainers; [ soupglasses ];
|
||||||
|
platforms = [ "x86_64-linux" "aarch64-linux" ];
|
||||||
|
};
|
||||||
|
}
|
130
pkgs/applications/misc/ns-usbloader/make-deterministic.patch
Normal file
130
pkgs/applications/misc/ns-usbloader/make-deterministic.patch
Normal file
|
@ -0,0 +1,130 @@
|
||||||
|
From 3f85e2754144bbf2805ba68d8c76b3dec3299f4d Mon Sep 17 00:00:00 2001
|
||||||
|
From: Sofi <sofi+git@mailbox.org>
|
||||||
|
Date: Sat, 29 Jul 2023 11:16:38 +0200
|
||||||
|
Subject: [PATCH] make deterministic
|
||||||
|
|
||||||
|
---
|
||||||
|
pom.xml | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++------
|
||||||
|
1 file changed, 57 insertions(+), 6 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/pom.xml b/pom.xml
|
||||||
|
index 320d4f3..5a594e6 100644
|
||||||
|
--- a/pom.xml
|
||||||
|
+++ b/pom.xml
|
||||||
|
@@ -51,6 +51,7 @@
|
||||||
|
<maven.build.timestamp.format>yyyyMMdd.HHmmss</maven.build.timestamp.format>
|
||||||
|
<javafx.version>19.0.2.1</javafx.version>
|
||||||
|
<maven.compiler.release>11</maven.compiler.release>
|
||||||
|
+ <project.build.outputTimestamp>2023-01-01T00:00:00Z</project.build.outputTimestamp>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<issueManagement>
|
||||||
|
@@ -166,7 +167,7 @@
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
<build>
|
||||||
|
- <finalName>${project.artifactId}-${project.version}-${maven.build.timestamp}</finalName>
|
||||||
|
+ <finalName>${project.artifactId}-${project.version}</finalName>
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<directory>src/main/resources</directory>
|
||||||
|
@@ -193,26 +194,51 @@
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
|
- <version>2.22.2</version>
|
||||||
|
+ <version>3.1.2</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-failsafe-plugin</artifactId>
|
||||||
|
- <version>2.22.2</version>
|
||||||
|
+ <version>3.1.2</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
- <version>3.10.1</version>
|
||||||
|
+ <version>3.11.0</version>
|
||||||
|
<configuration>
|
||||||
|
<release>11</release>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
+ <plugin>
|
||||||
|
+ <groupId>org.apache.maven.plugins</groupId>
|
||||||
|
+ <artifactId>maven-enforcer-plugin</artifactId>
|
||||||
|
+ <version>3.3.0</version>
|
||||||
|
+ <executions>
|
||||||
|
+ <execution>
|
||||||
|
+ <id>enforce-versions</id>
|
||||||
|
+ <phase>validate</phase>
|
||||||
|
+ <goals>
|
||||||
|
+ <goal>enforce</goal>
|
||||||
|
+ </goals>
|
||||||
|
+ <configuration>
|
||||||
|
+ <rules>
|
||||||
|
+ <requireMavenVersion>
|
||||||
|
+ <version>[3.2.5,)</version>
|
||||||
|
+ </requireMavenVersion>
|
||||||
|
+ <requireJavaVersion>
|
||||||
|
+ <version>[1.8,)</version>
|
||||||
|
+ </requireJavaVersion>
|
||||||
|
+ <requirePluginVersions />
|
||||||
|
+ </rules>
|
||||||
|
+ </configuration>
|
||||||
|
+ </execution>
|
||||||
|
+ </executions>
|
||||||
|
+ </plugin>
|
||||||
|
<!-- Don't generate default JAR without dependencies -->
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-jar-plugin</artifactId>
|
||||||
|
- <version>3.1.2</version>
|
||||||
|
+ <version>3.3.0</version>
|
||||||
|
<!--
|
||||||
|
<configuration>
|
||||||
|
<manifestEntries>
|
||||||
|
@@ -231,7 +257,7 @@
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-assembly-plugin</artifactId>
|
||||||
|
- <version>3.1.0</version>
|
||||||
|
+ <version>3.6.0</version>
|
||||||
|
<configuration>
|
||||||
|
<archive>
|
||||||
|
<manifest>
|
||||||
|
@@ -253,6 +279,31 @@
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
+ <plugin>
|
||||||
|
+ <groupId>org.apache.maven.plugins</groupId>
|
||||||
|
+ <artifactId>maven-deploy-plugin</artifactId>
|
||||||
|
+ <version>3.1.1</version>
|
||||||
|
+ </plugin>
|
||||||
|
+ <plugin>
|
||||||
|
+ <groupId>org.apache.maven.plugins</groupId>
|
||||||
|
+ <artifactId>maven-resources-plugin</artifactId>
|
||||||
|
+ <version>3.3.1</version>
|
||||||
|
+ </plugin>
|
||||||
|
+ <plugin>
|
||||||
|
+ <groupId>org.apache.maven.plugins</groupId>
|
||||||
|
+ <artifactId>maven-site-plugin</artifactId>
|
||||||
|
+ <version>4.0.0-M9</version>
|
||||||
|
+ </plugin>
|
||||||
|
+ <plugin>
|
||||||
|
+ <groupId>org.apache.maven.plugins</groupId>
|
||||||
|
+ <artifactId>maven-install-plugin</artifactId>
|
||||||
|
+ <version>3.1.1</version>
|
||||||
|
+ </plugin>
|
||||||
|
+ <plugin>
|
||||||
|
+ <groupId>org.apache.maven.plugins</groupId>
|
||||||
|
+ <artifactId>maven-clean-plugin</artifactId>
|
||||||
|
+ <version>3.3.1</version>
|
||||||
|
+ </plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</project>
|
||||||
|
--
|
||||||
|
2.41.0
|
||||||
|
|
70
pkgs/applications/misc/ns-usbloader/no-launch4j.patch
Normal file
70
pkgs/applications/misc/ns-usbloader/no-launch4j.patch
Normal file
|
@ -0,0 +1,70 @@
|
||||||
|
From ead7a3b988a47a3896ea8a3ff01556e073115f16 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Sofi <sofi+git@mailbox.org>
|
||||||
|
Date: Thu, 27 Jul 2023 17:23:31 +0200
|
||||||
|
Subject: [PATCH] No launch4j
|
||||||
|
|
||||||
|
---
|
||||||
|
pom.xml | 47 +----------------------------------------------
|
||||||
|
1 file changed, 1 insertion(+), 46 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/pom.xml b/pom.xml
|
||||||
|
index 21352e0..320d4f3 100644
|
||||||
|
--- a/pom.xml
|
||||||
|
+++ b/pom.xml
|
||||||
|
@@ -253,51 +253,6 @@
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
- <plugin>
|
||||||
|
- <groupId>com.akathist.maven.plugins.launch4j</groupId>
|
||||||
|
- <version>2.2.0</version>
|
||||||
|
- <artifactId>launch4j-maven-plugin</artifactId>
|
||||||
|
- <executions>
|
||||||
|
- <execution>
|
||||||
|
- <id>l4j-ns-usbloader</id>
|
||||||
|
- <phase>package</phase>
|
||||||
|
- <goals>
|
||||||
|
- <goal>launch4j</goal>
|
||||||
|
- </goals>
|
||||||
|
- <configuration>
|
||||||
|
- <headerType>gui</headerType>
|
||||||
|
- <icon>appicon.ico</icon>
|
||||||
|
- <outfile>target/${project.name}.exe</outfile>
|
||||||
|
- <jar>target/${project.artifactId}-${project.version}-${maven.build.timestamp}.jar</jar>
|
||||||
|
- <!-- <downloadUrl>https://download.oracle.com/java/17/archive/jdk-17.0.1_windows-x64_bin.msi</downloadUrl> -->
|
||||||
|
- <errTitle>Launching error</errTitle>
|
||||||
|
- <!-- <dontWrapJar>true</dontWrapJar> -->
|
||||||
|
- <jre>
|
||||||
|
- <path>%PWD%/jdk</path>
|
||||||
|
- <minVersion>11.0.0</minVersion>
|
||||||
|
- </jre>
|
||||||
|
- <versionInfo>
|
||||||
|
- <fileVersion>${project.version}.0.0</fileVersion>
|
||||||
|
- <txtFileVersion>${project.version}</txtFileVersion>
|
||||||
|
- <fileDescription>NS multi-tool</fileDescription>
|
||||||
|
- <copyright>GNU General Public License v3, ${project.inceptionYear} ${project.organization.name}, Russia.</copyright>
|
||||||
|
- <productVersion>${project.version}.0.0</productVersion>
|
||||||
|
- <txtProductVersion>${project.version}</txtProductVersion>
|
||||||
|
- <companyName>${project.organization.name}</companyName>
|
||||||
|
- <productName>${project.name}</productName>
|
||||||
|
- <internalName>${project.name}</internalName>
|
||||||
|
- <originalFilename>${project.name}.exe</originalFilename>
|
||||||
|
- </versionInfo>
|
||||||
|
- <messages>
|
||||||
|
- <startupErr>Startup error</startupErr>
|
||||||
|
- <jreNotFoundErr>JDK not found</jreNotFoundErr>
|
||||||
|
- <jreVersionErr>JDK Version mismatch</jreVersionErr>
|
||||||
|
- <launcherErr>Launcher Error</launcherErr>
|
||||||
|
- </messages>
|
||||||
|
- </configuration>
|
||||||
|
- </execution>
|
||||||
|
- </executions>
|
||||||
|
- </plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
-</project>
|
||||||
|
\ No newline at end of file
|
||||||
|
+</project>
|
||||||
|
--
|
||||||
|
2.41.0
|
||||||
|
|
|
@ -33716,6 +33716,8 @@ with pkgs;
|
||||||
|
|
||||||
novnc = callPackage ../applications/networking/novnc { };
|
novnc = callPackage ../applications/networking/novnc { };
|
||||||
|
|
||||||
|
ns-usbloader = callPackage ../applications/misc/ns-usbloader { };
|
||||||
|
|
||||||
nwg-bar = callPackage ../applications/misc/nwg-bar { };
|
nwg-bar = callPackage ../applications/misc/nwg-bar { };
|
||||||
|
|
||||||
nwg-dock = callPackage ../applications/misc/nwg-dock { };
|
nwg-dock = callPackage ../applications/misc/nwg-dock { };
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue