diff options
author | Timo Wilken | 2024-05-28 18:58:04 +0200 |
---|---|---|
committer | Timo Wilken | 2024-05-28 20:22:51 +0200 |
commit | 367b0e7c1788ffdbbb5f6df29a55fd1bc7d21463 (patch) | |
tree | a78351b67d35dcc266d3dc87884cc65f383f2f3f /tw/packages/games.scm | |
parent | 284ed1729c15c2466968c40e7aa30b8405d9f36f (diff) |
Set up Minecraft server
Diffstat (limited to 'tw/packages/games.scm')
-rw-r--r-- | tw/packages/games.scm | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/tw/packages/games.scm b/tw/packages/games.scm index 28ffbaa3..76520051 100644 --- a/tw/packages/games.scm +++ b/tw/packages/games.scm @@ -19,6 +19,7 @@ #:use-module (gnu packages gtk) #:use-module (gnu packages guile) #:use-module (gnu packages image) + #:use-module (gnu packages java) #:use-module (gnu packages linux) #:use-module (gnu packages lua) #:use-module (gnu packages pkg-config) @@ -606,3 +607,46 @@ Create the route of your dreams in a world where you set the pace, and embark on an ever-expanding railway extravaganza.") (license (nonguix-license:undistributable "file://data/noarch/docs/End User License Agreement.txt")))) + + +;;; Minecraft server + +;; See versions in: +;; https://piston-meta.mojang.com/mc/game/version_manifest.json +;; ...which links to: +;; https://piston-meta.mojang.com/v1/packages/111890b5a8c2fee9b77036f9f377b33df42c718a/1.20.6.json + +(define-public minecraft-server + (package + (name "minecraft-server") + (version "1.20.6") + (source + (origin + (method url-fetch) + (uri "https://piston-data.mojang.com/v1/objects/145ff0858209bcfc164859ba735d4199aafa1eea/server.jar") + (sha256 (base32 "1v6755nch6v8q4jvc8liprw50mpx8wnnaq7cy03fb0m7ih0ivl66")))) + (build-system trivial-build-system) + (arguments + `(#:builder + ,(with-imported-modules + (source-module-closure '((guix build utils))) + #~(begin + (use-modules (guix build utils)) + (for-each (lambda (dir) + (mkdir-p (string-append #$output "/" dir))) + '("bin" "libexec")) + (copy-file #$source (string-append #$output "/libexec/server.jar")) + (call-with-output-file (string-append #$output "/bin/minecraft-server") + (lambda (port) + (format port "#!~a/bin/guile --no-auto-compile~%!#~%" #$guile-3.0) + (write `(apply execl #$(file-append openjdk21 "/bin/java") + "java" "-jar" ,(string-append #$output "/libexec/server.jar") + (cdr (command-line))) + port) + (chmod port #o555))))))) + (inputs (list openjdk21 guile-3.0)) + (home-page "https://www.minecraft.net/") + (synopsis "Server for the well-known block building sandbox game") + (description "Server software for Minecraft.") + (license (nonguix-license:undistributable + "https://www.minecraft.net/en-us/eula")))) |