Compare commits

...
3 Commits
Author SHA1 Message Date
Jan-Bulthuis 7e1f66d324 Restructured flake 2025-05-18 06:08:02 +02:00
Jan-Bulthuis 53096fdc3e Added create 2025-05-18 05:23:36 +02:00
Jan-Bulthuis 0f267e798f Completed modpack flake 2025-05-18 05:23:30 +02:00
9 changed files with 156 additions and 70 deletions

No files matched your search

Generated
+9 -20
View File
@@ -72,7 +72,9 @@
"inputs": { "inputs": {
"flake-compat": "flake-compat", "flake-compat": "flake-compat",
"flake-utils": "flake-utils", "flake-utils": "flake-utils",
"nixpkgs": "nixpkgs" "nixpkgs": [
"nixpkgs"
]
}, },
"locked": { "locked": {
"lastModified": 1747526922, "lastModified": 1747526922,
@@ -92,7 +94,7 @@
"inputs": { "inputs": {
"flake-compat": "flake-compat_2", "flake-compat": "flake-compat_2",
"flake-utils": "flake-utils_2", "flake-utils": "flake-utils_2",
"nixpkgs": "nixpkgs_2" "nixpkgs": "nixpkgs"
}, },
"locked": { "locked": {
"lastModified": 1747526922, "lastModified": 1747526922,
@@ -111,7 +113,9 @@
"nix-modpack": { "nix-modpack": {
"inputs": { "inputs": {
"nix-minecraft": "nix-minecraft_2", "nix-minecraft": "nix-minecraft_2",
"nixpkgs": "nixpkgs_3" "nixpkgs": [
"nixpkgs"
]
}, },
"locked": { "locked": {
"path": "./nix-modpack", "path": "./nix-modpack",
@@ -140,22 +144,6 @@
} }
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": {
"lastModified": 1742889210,
"narHash": "sha256-hw63HnwnqU3ZQfsMclLhMvOezpM7RSB0dMAtD5/sOiw=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "698214a32beb4f4c8e3942372c694f40848b360d",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": { "locked": {
"lastModified": 1747327360, "lastModified": 1747327360,
"narHash": "sha256-LSmTbiq/nqZR9B2t4MRnWG7cb0KVNU70dB7RT4+wYK4=", "narHash": "sha256-LSmTbiq/nqZR9B2t4MRnWG7cb0KVNU70dB7RT4+wYK4=",
@@ -174,7 +162,8 @@
"root": { "root": {
"inputs": { "inputs": {
"nix-minecraft": "nix-minecraft", "nix-minecraft": "nix-minecraft",
"nix-modpack": "nix-modpack" "nix-modpack": "nix-modpack",
"nixpkgs": "nixpkgs_2"
} }
}, },
"systems": { "systems": {
+28 -2
View File
@@ -2,14 +2,40 @@
description = "Minecraft Modpack"; description = "Minecraft Modpack";
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nix-modpack.url = "./nix-modpack"; nix-modpack.url = "./nix-modpack";
nix-modpack.inputs.nixpkgs.follows = "nixpkgs";
nix-minecraft.url = "github:Jan-Bulthuis/nix-minecraft"; nix-minecraft.url = "github:Jan-Bulthuis/nix-minecraft";
nix-minecraft.inputs.nixpkgs.follows = "nixpkgs";
}; };
outputs = outputs =
inputs: inputs:
inputs.nix-modpack (system: { let
lib = inputs.nixpkgs.lib;
eachSystem =
fn: lib.genAttrs lib.systems.flakeExposed (system: fn (import inputs.nixpkgs { inherit system; }));
in
{
packages = eachSystem (pkgs: {
server = inputs.nix-modpack.packages.${pkgs.system}.mkServer {
packUrl = "https://git.bulthuis.dev/Jan/Modpack/raw/branch/main/pack.toml"; packUrl = "https://git.bulthuis.dev/Jan/Modpack/raw/branch/main/pack.toml";
server = inputs.nix-minecraft.legacyPackages.${system}.neoForgeServers.neoforge-21_1_172; server = inputs.nix-minecraft.legacyPackages.${pkgs.system}.neoForgeServers.neoforge-21_1_172;
};
client = inputs.nix-modpack.packages.${pkgs.system}.mkClient {
packUrl = "https://git.bulthuis.dev/Jan/Modpack/raw/branch/main/pack.toml";
gameVersion = "1.21.1";
loaderUid = "net.neoforged";
loaderVersion = "21.1.172";
};
}); });
devShells = eachSystem (pkgs: {
default = pkgs.mkShell {
buildInputs = with pkgs; [
packwiz
];
};
});
};
} }
+5
View File
@@ -5,6 +5,11 @@ file = "mods/ars-nouveau.pw.toml"
hash = "c620b91abf14510baca9164bdd1ab39b8f6390c080c7a8f67e66b7fa25b515b5" hash = "c620b91abf14510baca9164bdd1ab39b8f6390c080c7a8f67e66b7fa25b515b5"
metafile = true metafile = true
[[files]]
file = "mods/create.pw.toml"
hash = "a4c8371232d9f542b180c7bd7e30d84b9e958b97b24af5dde0759ab8e511fb8e"
metafile = true
[[files]] [[files]]
file = "mods/curios.pw.toml" file = "mods/curios.pw.toml"
hash = "36debf7653e95a855b4fedacc19027cf2e01960fc0b6d55ef2ffbffbcb455690" hash = "36debf7653e95a855b4fedacc19027cf2e01960fc0b6d55ef2ffbffbcb455690"
+13
View File
@@ -0,0 +1,13 @@
name = "Create"
filename = "create-1.21.1-6.0.4.jar"
side = "both"
[download]
url = "https://cdn.modrinth.com/data/LNytGWDc/versions/5LpL274U/create-1.21.1-6.0.4.jar"
hash-format = "sha512"
hash = "1f237647ad48c8d9b09a7dab84ac16fc52bb2b70eec5c0f836b21658e60af8cdcbc541c57ac43ffa80fbecad8c08d7bdc13fbd387aaa38f8a25df20a095d5412"
[update]
[update.modrinth]
mod-id = "LNytGWDc"
version = "5LpL274U"
+16 -4
View File
@@ -6,13 +6,25 @@
}; };
outputs = outputs =
{ nixpkgs, nix-minecraft, ... }: inputs:
let let
lib = import ./lib { lib = inputs.nixpkgs.lib;
inherit nixpkgs nix-minecraft; eachSystem =
fn: lib.genAttrs lib.systems.flakeExposed (system: fn (import inputs.nixpkgs { inherit system; }));
in
{
packages = eachSystem (
pkgs:
let
bootstrap = pkgs.fetchurl {
url = "https://github.com/packwiz/packwiz-installer-bootstrap/releases/download/v0.0.3/packwiz-installer-bootstrap.jar";
sha256 = "qPuyTcYEJ46X9GiOgtPZGjGLmO/AjV2/y8vKtkQ9EWw=";
}; };
in in
{ {
__functor = _: lib; mkServer = pkgs.callPackage ./packages/mkServer.nix { inherit bootstrap; };
mkClient = pkgs.callPackage ./packages/mkClient.nix { inherit bootstrap; };
}
);
}; };
} }
-43
View File
@@ -1,43 +0,0 @@
{ nixpkgs, ... }:
let
lib = nixpkgs.lib;
eachSystem =
fn: lib.genAttrs lib.systems.flakeExposed (system: fn (import nixpkgs { inherit system; }));
mkModpack =
builder:
let
mkPackages =
pkgs:
let
bootstrap = pkgs.fetchurl {
url = "https://github.com/packwiz/packwiz-installer-bootstrap/releases/download/v0.0.3/packwiz-installer-bootstrap.jar";
sha256 = "qPuyTcYEJ46X9GiOgtPZGjGLmO/AjV2/y8vKtkQ9EWw=";
};
buildInfo = builder pkgs.system;
in
lib.trace buildInfo {
server = pkgs.writeShellScriptBin "minecraft-server" ''
${lib.getExe pkgs.jre} -jar ${bootstrap} -g -s server ${buildInfo.packUrl}
# ${buildInfo.server}/bin/minecraft-server
'';
};
overlay = final: prev: mkPackages prev;
in
{
inherit overlay;
packages = eachSystem mkPackages;
devShells = eachSystem (pkgs: {
default = pkgs.mkShell {
buildInputs = with pkgs; [
packwiz
];
};
});
};
in
mkModpack
+67
View File
@@ -0,0 +1,67 @@
{
lib,
pkgs,
bootstrap,
...
}:
{
packUrl,
gameVersion,
loaderUid,
loaderVersion,
}:
pkgs.stdenvNoCC.mkDerivation {
name = "minecraft-client";
dontUnpack = true;
mmcpack = ''
{
"components": [
{
"important": true,
"uid": "net.minecraft",
"version": "${gameVersion}"
},
{
"uid": "${loaderUid}",
"version": "${loaderVersion}"
}
],
"formatVersion": 1
}
'';
instancecfg = pkgs.writeText "instance.cfg" ''
[General]
ConfigVersion=1.2
InstanceType=OneSix
OverrideCommands=true
PreLaunchCommand=\"$INST_JAVA\" -jar packwiz-installer-bootstrap.jar ${packUrl}
'';
buildPhase = ''
# Remove env-vars
rm env-vars
# Add the mmc-pack
echo $mmcpack > ./mmc-pack.json
# Add the instance-cfg
cp $instancecfg ./instance.cfg
# Add the bootstrap jar
mkdir ./minecraft
cp ${bootstrap} ./minecraft/packwiz-installer-bootstrap.jar
# Zip everything together
${pkgs.zip}/bin/zip -r modpack.zip ./*
'';
installPhase = ''
mkdir $out
mv modpack.zip $out/
'';
}
+17
View File
@@ -0,0 +1,17 @@
{
lib,
pkgs,
bootstrap,
...
}:
{
packUrl,
server,
jre ? pkgs.jre,
}:
pkgs.writeShellScriptBin "minecraft-server" ''
${lib.getExe jre} -jar ${bootstrap} -g -s server ${packUrl}
${server}/bin/minecraft-server
''
+1 -1
View File
@@ -6,7 +6,7 @@ pack-format = "packwiz:1.1.0"
[index] [index]
file = "index.toml" file = "index.toml"
hash-format = "sha256" hash-format = "sha256"
hash = "d4bf8637735bbfd34cce2d1311bbf9fae66851c7cc06edb8a968085c447d8826" hash = "d5cb39f2e727842431b1108dba5751379992838f35f5893edf684b0913a3310f"
[versions] [versions]
minecraft = "1.21.1" minecraft = "1.21.1"