minecraftServers: init - move all minecraft-server versions into minecraftServers
This commit is contained in:
parent
e0843a80e2
commit
b254d2b1fe
@ -1,16 +1,15 @@
|
||||
{ callPackage, lib, javaPackages }:
|
||||
# if you add more versions make sure to add to all-packages.nix
|
||||
let
|
||||
versions = lib.importJSON ./versions.json;
|
||||
|
||||
latestVersion = lib.last (builtins.sort lib.versionOlder (builtins.attrNames versions));
|
||||
escapeVersion = builtins.replaceStrings [ "." ] [ "_" ];
|
||||
escapeVersion = builtins.replaceStrings [ "." ] [ "-" ];
|
||||
|
||||
getJavaVersion = v: (builtins.getAttr "openjdk${toString v}" javaPackages.compiler).headless;
|
||||
|
||||
packages = lib.mapAttrs'
|
||||
(version: value: {
|
||||
name = "minecraft-server_${escapeVersion version}";
|
||||
name = "vanilla-${escapeVersion version}";
|
||||
value = callPackage ./derivation.nix {
|
||||
inherit (value) version url sha1;
|
||||
jre_headless = getJavaVersion (if value.javaVersion == null then 8 else value.javaVersion); # versions <= 1.6 will default to 8
|
||||
@ -18,6 +17,8 @@ let
|
||||
})
|
||||
versions;
|
||||
in
|
||||
packages // {
|
||||
minecraft-server = builtins.getAttr "minecraft-server_${escapeVersion latestVersion}" packages;
|
||||
}
|
||||
lib.recurseIntoAttrs (
|
||||
packages // {
|
||||
vanilla = builtins.getAttr "vanilla-${escapeVersion latestVersion}" packages;
|
||||
}
|
||||
)
|
@ -30810,25 +30810,8 @@ with pkgs;
|
||||
|
||||
minecraft = callPackage ../games/minecraft { };
|
||||
|
||||
inherit (import ../games/minecraft-server { inherit callPackage lib javaPackages; })
|
||||
minecraft-server_1_2
|
||||
minecraft-server_1_3
|
||||
minecraft-server_1_4
|
||||
minecraft-server_1_5
|
||||
minecraft-server_1_6
|
||||
minecraft-server_1_7
|
||||
minecraft-server_1_8
|
||||
minecraft-server_1_9
|
||||
minecraft-server_1_10
|
||||
minecraft-server_1_11
|
||||
minecraft-server_1_12
|
||||
minecraft-server_1_13
|
||||
minecraft-server_1_14
|
||||
minecraft-server_1_15
|
||||
minecraft-server_1_16
|
||||
minecraft-server_1_17
|
||||
minecraft-server_1_18
|
||||
minecraft-server;
|
||||
minecraftServers = import ../games/minecraft-servers { inherit callPackage lib javaPackages; };
|
||||
minecraft-server = minecraftServers.vanilla; # backwards compatibility
|
||||
|
||||
moon-buggy = callPackage ../games/moon-buggy {};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user