Compare commits

...

2 Commits

Author SHA1 Message Date
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
9 changed files with 114 additions and 39 deletions

1
.gitignore vendored
View File

@ -0,0 +1 @@
test

View File

@ -1,4 +1,7 @@
.direnv .direnv
.envrc .envrc
result result
nix-modpack nix-modpack
test
flake.nix
flake.lock

87
flake.lock generated
View File

@ -16,6 +16,22 @@
"type": "github" "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": { "flake-utils": {
"inputs": { "inputs": {
"systems": "systems" "systems": "systems"
@ -34,6 +50,24 @@
"type": "github" "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": { "nix-minecraft": {
"inputs": { "inputs": {
"flake-compat": "flake-compat", "flake-compat": "flake-compat",
@ -54,10 +88,30 @@
"type": "github" "type": "github"
} }
}, },
"nix-minecraft_2": {
"inputs": {
"flake-compat": "flake-compat_2",
"flake-utils": "flake-utils_2",
"nixpkgs": "nixpkgs_2"
},
"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-modpack": { "nix-modpack": {
"inputs": { "inputs": {
"nix-minecraft": "nix-minecraft", "nix-minecraft": "nix-minecraft_2",
"nixpkgs": "nixpkgs_2" "nixpkgs": "nixpkgs_3"
}, },
"locked": { "locked": {
"path": "./nix-modpack", "path": "./nix-modpack",
@ -87,15 +141,15 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1747327360, "lastModified": 1742889210,
"narHash": "sha256-LSmTbiq/nqZR9B2t4MRnWG7cb0KVNU70dB7RT4+wYK4=", "narHash": "sha256-hw63HnwnqU3ZQfsMclLhMvOezpM7RSB0dMAtD5/sOiw=",
"owner": "NixOS", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "e06158e58f3adee28b139e9c2bcfcc41f8625b46", "rev": "698214a32beb4f4c8e3942372c694f40848b360d",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "owner": "nixos",
"ref": "nixos-unstable", "ref": "nixos-unstable",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
@ -119,8 +173,8 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"nix-modpack": "nix-modpack", "nix-minecraft": "nix-minecraft",
"nixpkgs": "nixpkgs_3" "nix-modpack": "nix-modpack"
} }
}, },
"systems": { "systems": {
@ -137,6 +191,21 @@
"repo": "default", "repo": "default",
"type": "github" "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", "root": "root",

View File

@ -2,14 +2,14 @@
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-minecraft.url = "github:Jan-Bulthuis/nix-minecraft";
}; };
outputs = outputs =
inputs: inputs:
inputs.nix-modpack { inputs.nix-modpack (system: {
inherit inputs; packUrl = "https://git.bulthuis.dev/Jan/Modpack/raw/branch/main/pack.toml";
url = "https://git.bulthuis.dev/Jan/Modpack"; server = inputs.nix-minecraft.legacyPackages.${system}.neoForgeServers.neoforge-21_1_172;
}; });
} }

View File

@ -1,13 +1,5 @@
hash-format = "sha256" hash-format = "sha256"
[[files]]
file = "flake.lock"
hash = "e1c46cb3d49cbdd61b8771503c0a48835e1a012da29ee6597992e891b4539c5b"
[[files]]
file = "flake.nix"
hash = "dc48bc9897ff3d48edcf6d171f05ee9667f7a4eacec22ecc0d8da83fb29ecdc2"
[[files]] [[files]]
file = "mods/ars-nouveau.pw.toml" file = "mods/ars-nouveau.pw.toml"
hash = "c620b91abf14510baca9164bdd1ab39b8f6390c080c7a8f67e66b7fa25b515b5" hash = "c620b91abf14510baca9164bdd1ab39b8f6390c080c7a8f67e66b7fa25b515b5"

View File

@ -2,14 +2,14 @@
description = "Create nix derivations from a packwiz modpack"; description = "Create nix derivations from a packwiz modpack";
inputs = { inputs = {
nix-minecraft.url = "github:Jan-Bulthuis/nix-minecraft"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
}; };
outputs = outputs =
{ nix-minecraft, ... }: { nixpkgs, nix-minecraft, ... }:
let let
lib = import ./lib { lib = import ./lib {
inherit nix-minecraft; inherit nixpkgs nix-minecraft;
}; };
in in
{ {

View File

@ -1,20 +1,30 @@
{ nix-minecraft, ... }: { nixpkgs, ... }:
let let
lib = nixpkgs.lib;
eachSystem =
fn: lib.genAttrs lib.systems.flakeExposed (system: fn (import nixpkgs { inherit system; }));
mkModpack = mkModpack =
{ inputs }: builder:
let let
nixpkgs = inputs.nixpkgs; mkPackages =
lib = nixpkgs.lib; 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=";
};
eachSystem = buildInfo = builder pkgs.system;
fn: lib.genAttrs lib.systems.flakeExposed (system: fn (import nixpkgs { inherit system; })); in
lib.trace buildInfo {
mkPackages = pkgs: { server = pkgs.writeShellScriptBin "minecraft-server" ''
modpack = nix-minecraft.legacyPackages.${pkgs.system}.fetchPackwizModpack { ${lib.getExe pkgs.jre} -jar ${bootstrap} -g -s server ${buildInfo.packUrl}
url = inputs.self; # ${buildInfo.server}/bin/minecraft-server
'';
}; };
};
overlay = final: prev: mkPackages prev; overlay = final: prev: mkPackages prev;
in in

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 = "3cb74ac6e3a0106ec14ed43f4b6f64c4dbc95688c7824f884745699bd54a5a07" hash = "d4bf8637735bbfd34cce2d1311bbf9fae66851c7cc06edb8a968085c447d8826"
[versions] [versions]
minecraft = "1.21.1" minecraft = "1.21.1"

2
result
View File

@ -1 +1 @@
/nix/store/7kz7ab64z7nf5mpdv3d21ncq0ndg5v0x-modpack-1.0.0 /nix/store/vl5npy1z774a3kmmyifdlscgfw8g3zia-minecraft-server