Updated flake

This commit is contained in:
Jan-Bulthuis 2025-05-18 04:27:57 +02:00
parent a1b56f2353
commit ac24d5aa95
5 changed files with 108 additions and 29 deletions

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

View File

@ -2,14 +2,14 @@
description = "Minecraft Modpack";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nix-modpack.url = "./nix-modpack";
nix-minecraft.url = "github:Jan-Bulthuis/nix-minecraft";
};
outputs =
inputs:
inputs.nix-modpack {
inherit inputs;
url = "https://git.bulthuis.dev/Jan/Modpack";
};
inputs.nix-modpack (system: {
packUrl = "https://git.bulthuis.dev/Jan/Modpack/raw/branch/main/pack.toml";
server = inputs.nix-minecraft.legacyPackages.${system}.neoForgeServers.neoforge-21_1_172;
});
}

View File

@ -2,14 +2,14 @@
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, ... }:
{ nixpkgs, nix-minecraft, ... }:
let
lib = import ./lib {
inherit nix-minecraft;
inherit nixpkgs nix-minecraft;
};
in
{

View File

@ -1,19 +1,29 @@
{ nix-minecraft, ... }:
{ nixpkgs, ... }:
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;
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;

2
result
View File

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