Compare commits

..
5 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
Jan-Bulthuis ac24d5aa95 Updated flake 2025-05-18 04:27:57 +02:00
Jan-Bulthuis a1b56f2353 Simple small pack 2025-05-18 04:27:48 +02:00
12 changed files with 231 additions and 70 deletions

No files matched your search

+1
View File
@@ -0,0 +1 @@
test
+3
View File
@@ -2,3 +2,6 @@
.envrc
result
nix-modpack
test
flake.nix
flake.lock
Generated
+77 -19
View File
@@ -16,6 +16,22 @@
"type": "github"
}
},
"flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1733328505,
"narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
@@ -34,10 +50,50 @@
"type": "github"
}
},
"flake-utils_2": {
"inputs": {
"systems": "systems_2"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nix-minecraft": {
"inputs": {
"flake-compat": "flake-compat",
"flake-utils": "flake-utils",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1747526922,
"narHash": "sha256-NmBP0W4RJ8NTkeaMKy/NNzMBIQDa8n161Igbu7zWM2E=",
"owner": "Jan-Bulthuis",
"repo": "nix-minecraft",
"rev": "566b5218ff51d80da60873fe3b5930b8da12091c",
"type": "github"
},
"original": {
"owner": "Jan-Bulthuis",
"repo": "nix-minecraft",
"type": "github"
}
},
"nix-minecraft_2": {
"inputs": {
"flake-compat": "flake-compat_2",
"flake-utils": "flake-utils_2",
"nixpkgs": "nixpkgs"
},
"locked": {
@@ -56,8 +112,10 @@
},
"nix-modpack": {
"inputs": {
"nix-minecraft": "nix-minecraft",
"nixpkgs": "nixpkgs_2"
"nix-minecraft": "nix-minecraft_2",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"path": "./nix-modpack",
@@ -101,26 +159,11 @@
"type": "github"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1747327360,
"narHash": "sha256-LSmTbiq/nqZR9B2t4MRnWG7cb0KVNU70dB7RT4+wYK4=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e06158e58f3adee28b139e9c2bcfcc41f8625b46",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nix-minecraft": "nix-minecraft",
"nix-modpack": "nix-modpack",
"nixpkgs": "nixpkgs_3"
"nixpkgs": "nixpkgs_2"
}
},
"systems": {
@@ -137,6 +180,21 @@
"repo": "default",
"type": "github"
}
},
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
+29 -3
View File
@@ -4,12 +4,38 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nix-modpack.url = "./nix-modpack";
nix-modpack.inputs.nixpkgs.follows = "nixpkgs";
nix-minecraft.url = "github:Jan-Bulthuis/nix-minecraft";
nix-minecraft.inputs.nixpkgs.follows = "nixpkgs";
};
outputs =
inputs:
inputs.nix-modpack {
inherit inputs;
url = "https://git.bulthuis.dev/Jan/Modpack";
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";
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 -8
View File
@@ -1,18 +1,15 @@
hash-format = "sha256"
[[files]]
file = "flake.lock"
hash = "e1c46cb3d49cbdd61b8771503c0a48835e1a012da29ee6597992e891b4539c5b"
[[files]]
file = "flake.nix"
hash = "dc48bc9897ff3d48edcf6d171f05ee9667f7a4eacec22ecc0d8da83fb29ecdc2"
[[files]]
file = "mods/ars-nouveau.pw.toml"
hash = "c620b91abf14510baca9164bdd1ab39b8f6390c080c7a8f67e66b7fa25b515b5"
metafile = true
[[files]]
file = "mods/create.pw.toml"
hash = "a4c8371232d9f542b180c7bd7e30d84b9e958b97b24af5dde0759ab8e511fb8e"
metafile = true
[[files]]
file = "mods/curios.pw.toml"
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"
+17 -5
View File
@@ -2,17 +2,29 @@
description = "Create nix derivations from a packwiz modpack";
inputs = {
nix-minecraft.url = "github:Jan-Bulthuis/nix-minecraft";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs =
{ nix-minecraft, ... }:
inputs:
let
lib = import ./lib {
inherit nix-minecraft;
lib = inputs.nixpkgs.lib;
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
{
__functor = _: lib;
mkServer = pkgs.callPackage ./packages/mkServer.nix { inherit bootstrap; };
mkClient = pkgs.callPackage ./packages/mkClient.nix { inherit bootstrap; };
}
);
};
}
-33
View File
@@ -1,33 +0,0 @@
{ nix-minecraft, ... }:
let
mkModpack =
{ inputs }:
let
nixpkgs = inputs.nixpkgs;
lib = nixpkgs.lib;
eachSystem =
fn: lib.genAttrs lib.systems.flakeExposed (system: fn (import nixpkgs { inherit system; }));
mkPackages = pkgs: {
modpack = nix-minecraft.legacyPackages.${pkgs.system}.fetchPackwizModpack {
url = inputs.self;
};
};
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]
file = "index.toml"
hash-format = "sha256"
hash = "3cb74ac6e3a0106ec14ed43f4b6f64c4dbc95688c7824f884745699bd54a5a07"
hash = "d5cb39f2e727842431b1108dba5751379992838f35f5893edf684b0913a3310f"
[versions]
minecraft = "1.21.1"
+1 -1
View File
@@ -1 +1 @@
/nix/store/7kz7ab64z7nf5mpdv3d21ncq0ndg5v0x-modpack-1.0.0
/nix/store/vl5npy1z774a3kmmyifdlscgfw8g3zia-minecraft-server