From 97df33980cf46d4695aa186dcb2391f374e3e8ce Mon Sep 17 00:00:00 2001 From: seth Date: Fri, 12 May 2023 06:32:56 -0400 Subject: feat: start using mkMultiMCPack --- .github/workflows/build-modpack.yml | 4 +- files/.packignore | 7 +++ files/instance.cfg | 22 +++++++++ files/mmc-pack.json | 51 +++++++++++++++++++++ flake.lock | 6 +-- flake.nix | 13 ++++-- nix/default.nix | 9 ---- .../.minecraft/packwiz-installer-bootstrap.jar | Bin 98989 -> 0 bytes nix/files/.packignore | 7 --- nix/files/instance.cfg | 22 --------- nix/files/mmc-pack.json | 51 --------------------- 11 files changed, 94 insertions(+), 98 deletions(-) create mode 100644 files/.packignore create mode 100644 files/instance.cfg create mode 100644 files/mmc-pack.json delete mode 100644 nix/default.nix delete mode 100644 nix/files/.minecraft/packwiz-installer-bootstrap.jar delete mode 100644 nix/files/.packignore delete mode 100644 nix/files/instance.cfg delete mode 100644 nix/files/mmc-pack.json diff --git a/.github/workflows/build-modpack.yml b/.github/workflows/build-modpack.yml index aace7f9..7efd3d0 100644 --- a/.github/workflows/build-modpack.yml +++ b/.github/workflows/build-modpack.yml @@ -4,7 +4,7 @@ on: push: paths: # only run when prismlauncher modpack files are changed - - nix/files/** + - files/** workflow_dispatch: jobs: @@ -23,4 +23,4 @@ jobs: uses: actions/upload-artifact@v3 with: name: getchoo-modpack.zip - path: ${{ github.workspace }}/result/* + path: ${{ github.workspace }}/result/getchoo-modpack.zip diff --git a/files/.packignore b/files/.packignore new file mode 100644 index 0000000..448001c --- /dev/null +++ b/files/.packignore @@ -0,0 +1,7 @@ +.minecraft/coremods +.minecraft/mods +.minecraft/resourcepacks +.minecraft/saves +.minecraft/screenshots +.minecraft/shaderpacks +.minecraft/texturepacks \ No newline at end of file diff --git a/files/instance.cfg b/files/instance.cfg new file mode 100644 index 0000000..9e1afb7 --- /dev/null +++ b/files/instance.cfg @@ -0,0 +1,22 @@ +InstanceType=OneSix +JoinServerOnLaunch=false +JvmArgs=-XX:+UnlockExperimentalVMOptions -XX:+UnlockDiagnosticVMOptions -XX:+AlwaysActAsServerClassMachine -XX:+AlwaysPreTouch -XX:+DisableExplicitGC -XX:+UseNUMA -XX:NmethodSweepActivity=1 -XX:ReservedCodeCacheSize=400M -XX:NonNMethodCodeHeapSize=12M -XX:ProfiledCodeHeapSize=194M -XX:NonProfiledCodeHeapSize=194M -XX:-DontCompileHugeMethods -XX:MaxNodeLimit=240000 -XX:NodeLimitFudgeFactor=8000 -XX:+UseVectorCmov -XX:+PerfDisableSharedMem -XX:+UseFastUnorderedTimeStamps -XX:+UseCriticalJavaThreadPriority -XX:ThreadPriorityPolicy=1 -XX:AllocatePrefetchStyle=3 -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu -XX:ShenandoahGuaranteedGCInterval=1000000 -XX:AllocatePrefetchStyle=1 +MaxMemAlloc=4096 +MinMemAlloc=4096 +OverrideCommands=true +OverrideConsole=false +OverrideGameTime=false +OverrideJavaArgs=true +OverrideJavaLocation=false +OverrideMemory=true +OverrideMiscellaneous=false +OverrideNativeWorkarounds=false +OverridePerformance=false +OverrideWindow=false +PermGen=128 +PostExitCommand= +PreLaunchCommand="$INST_JAVA" -jar packwiz-installer-bootstrap.jar https://raw.githubusercontent.com/getchoo/modpack/main/pack.toml +WrapperCommand= +iconKey=default +name=getchoo-modpack +notes= diff --git a/files/mmc-pack.json b/files/mmc-pack.json new file mode 100644 index 0000000..624eee3 --- /dev/null +++ b/files/mmc-pack.json @@ -0,0 +1,51 @@ +{ + "components": [ + { + "cachedName": "LWJGL 3", + "cachedVersion": "3.3.1", + "cachedVolatile": true, + "dependencyOnly": true, + "uid": "org.lwjgl3", + "version": "3.3.1" + }, + { + "cachedName": "Minecraft", + "cachedRequires": [ + { + "suggests": "3.3.1", + "uid": "org.lwjgl3" + } + ], + "cachedVersion": "1.19.2", + "important": true, + "uid": "net.minecraft", + "version": "1.19.2" + }, + { + "cachedName": "Intermediary Mappings", + "cachedRequires": [ + { + "equals": "1.19.2", + "uid": "net.minecraft" + } + ], + "cachedVersion": "1.19.2", + "cachedVolatile": true, + "dependencyOnly": true, + "uid": "net.fabricmc.intermediary", + "version": "1.19.2" + }, + { + "cachedName": "Quilt Loader", + "cachedRequires": [ + { + "uid": "net.fabricmc.intermediary" + } + ], + "cachedVersion": "0.17.8", + "uid": "org.quiltmc.quilt-loader", + "version": "0.17.8" + } + ], + "formatVersion": 1 +} diff --git a/flake.lock b/flake.lock index 8c8749a..2f3abfc 100644 --- a/flake.lock +++ b/flake.lock @@ -17,11 +17,11 @@ }, "packwiz2nix": { "locked": { - "lastModified": 1683785033, - "narHash": "sha256-2j1kcX5A8rjUCYfoGXg/Nymb6S9kfn4dRRHkMM5hlBY=", + "lastModified": 1683887515, + "narHash": "sha256-eYxlzal5DNUvpv3F9W42wREdRi6h1hceOcgoiN6gvRg=", "owner": "getchoo", "repo": "packwiz2nix", - "rev": "a0c9b2378a0d1b3e57fda1d377b9914e3bc141b6", + "rev": "1c9c0ef2e40fbd1a921b446d8fe5884e645e4308", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index c956f57..cb8cbb3 100644 --- a/flake.nix +++ b/flake.nix @@ -7,12 +7,10 @@ }; outputs = { - self, nixpkgs, packwiz2nix, ... }: let - version = self.lastModifiedDate; systems = [ "x86_64-linux" "aarch64-linux" @@ -22,17 +20,24 @@ forAllSystems = nixpkgs.lib.genAttrs systems; nixpkgsFor = forAllSystems (system: import nixpkgs {inherit system;}); + inherit (packwiz2nix.lib) mkChecksumsApp mkMultiMCPack mkPackwizPackages; in { apps = forAllSystems (s: let pkgs = nixpkgsFor.${s}; in { - generate-checksums = packwiz2nix.lib.mkChecksumsApp pkgs ./mods; + generate-checksums = mkChecksumsApp pkgs ./mods; }); packages = forAllSystems (s: let pkgs = nixpkgsFor.${s}; + mods = mkPackwizPackages pkgs ./checksums.json; in rec { - getchoo-modpack = pkgs.callPackage ./nix {inherit version;}; + getchoo-modpack = mkMultiMCPack { + inherit pkgs mods; + filesDir = ./files; + name = "getchoo-modpack"; + }; + default = getchoo-modpack; }); diff --git a/nix/default.nix b/nix/default.nix deleted file mode 100644 index bd61190..0000000 --- a/nix/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ - runCommand, - zip, - ... -}: -runCommand "getchoo-modpack" {} '' - mkdir -p "$out" - ${zip}/bin/zip "$out"/getchoo-modpack.zip ${./files}/{*,.*} -'' diff --git a/nix/files/.minecraft/packwiz-installer-bootstrap.jar b/nix/files/.minecraft/packwiz-installer-bootstrap.jar deleted file mode 100644 index 84b934c..0000000 Binary files a/nix/files/.minecraft/packwiz-installer-bootstrap.jar and /dev/null differ diff --git a/nix/files/.packignore b/nix/files/.packignore deleted file mode 100644 index 448001c..0000000 --- a/nix/files/.packignore +++ /dev/null @@ -1,7 +0,0 @@ -.minecraft/coremods -.minecraft/mods -.minecraft/resourcepacks -.minecraft/saves -.minecraft/screenshots -.minecraft/shaderpacks -.minecraft/texturepacks \ No newline at end of file diff --git a/nix/files/instance.cfg b/nix/files/instance.cfg deleted file mode 100644 index 9e1afb7..0000000 --- a/nix/files/instance.cfg +++ /dev/null @@ -1,22 +0,0 @@ -InstanceType=OneSix -JoinServerOnLaunch=false -JvmArgs=-XX:+UnlockExperimentalVMOptions -XX:+UnlockDiagnosticVMOptions -XX:+AlwaysActAsServerClassMachine -XX:+AlwaysPreTouch -XX:+DisableExplicitGC -XX:+UseNUMA -XX:NmethodSweepActivity=1 -XX:ReservedCodeCacheSize=400M -XX:NonNMethodCodeHeapSize=12M -XX:ProfiledCodeHeapSize=194M -XX:NonProfiledCodeHeapSize=194M -XX:-DontCompileHugeMethods -XX:MaxNodeLimit=240000 -XX:NodeLimitFudgeFactor=8000 -XX:+UseVectorCmov -XX:+PerfDisableSharedMem -XX:+UseFastUnorderedTimeStamps -XX:+UseCriticalJavaThreadPriority -XX:ThreadPriorityPolicy=1 -XX:AllocatePrefetchStyle=3 -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu -XX:ShenandoahGuaranteedGCInterval=1000000 -XX:AllocatePrefetchStyle=1 -MaxMemAlloc=4096 -MinMemAlloc=4096 -OverrideCommands=true -OverrideConsole=false -OverrideGameTime=false -OverrideJavaArgs=true -OverrideJavaLocation=false -OverrideMemory=true -OverrideMiscellaneous=false -OverrideNativeWorkarounds=false -OverridePerformance=false -OverrideWindow=false -PermGen=128 -PostExitCommand= -PreLaunchCommand="$INST_JAVA" -jar packwiz-installer-bootstrap.jar https://raw.githubusercontent.com/getchoo/modpack/main/pack.toml -WrapperCommand= -iconKey=default -name=getchoo-modpack -notes= diff --git a/nix/files/mmc-pack.json b/nix/files/mmc-pack.json deleted file mode 100644 index 624eee3..0000000 --- a/nix/files/mmc-pack.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "components": [ - { - "cachedName": "LWJGL 3", - "cachedVersion": "3.3.1", - "cachedVolatile": true, - "dependencyOnly": true, - "uid": "org.lwjgl3", - "version": "3.3.1" - }, - { - "cachedName": "Minecraft", - "cachedRequires": [ - { - "suggests": "3.3.1", - "uid": "org.lwjgl3" - } - ], - "cachedVersion": "1.19.2", - "important": true, - "uid": "net.minecraft", - "version": "1.19.2" - }, - { - "cachedName": "Intermediary Mappings", - "cachedRequires": [ - { - "equals": "1.19.2", - "uid": "net.minecraft" - } - ], - "cachedVersion": "1.19.2", - "cachedVolatile": true, - "dependencyOnly": true, - "uid": "net.fabricmc.intermediary", - "version": "1.19.2" - }, - { - "cachedName": "Quilt Loader", - "cachedRequires": [ - { - "uid": "net.fabricmc.intermediary" - } - ], - "cachedVersion": "0.17.8", - "uid": "org.quiltmc.quilt-loader", - "version": "0.17.8" - } - ], - "formatVersion": 1 -} -- cgit v1.2.3