From ee8fac8ab8529e2d105c7e55c2c9b28aefd19b46 Mon Sep 17 00:00:00 2001 From: "W. Kosior" Date: Mon, 27 May 2024 12:19:19 +0200 Subject: Update and add remaining files. --- abdul-blog/minetest-server.gmi | 105 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 abdul-blog/minetest-server.gmi (limited to 'abdul-blog/minetest-server.gmi') diff --git a/abdul-blog/minetest-server.gmi b/abdul-blog/minetest-server.gmi new file mode 100644 index 0000000..0a0c819 --- /dev/null +++ b/abdul-blog/minetest-server.gmi @@ -0,0 +1,105 @@ +# Mine Minetest + +Haha, 2x "Mine", I hope you see an joke. +I write to explain you how I setup minetest server under this Tilde UNIX server. Also is this mine first blog post which only is on Gemini and not on HTTPS. You have to installed a Gemini client to reading it. + +## Guix config + +Mine Guix Home config has growing a lot and this is now + +``` +(use-modules ((gnu home) #:select (home-environment)) + ((gnu home services) #:select + (home-files-service-type service service-extension + service-type)) + ((gnu home services shells) #:select + (home-bash-configuration home-bash-service-type)) + ((gnu home services shepherd) #:select + (home-shepherd-service-type shepherd-service)) + ((gnu packages minetest) #:select (minetest-server)) + ((gnu system shadow) #:select (%default-dotguile)) + ((guix gexp) #:select (file-append gexp local-file plain-file))) + +(define home-minetest-services + (const + (list (shepherd-service + (provision '(minetest)) + (modules '((shepherd support))) ;for '%user-log-dir' + (start #~(make-forkexec-constructor + '(#$(file-append minetest-server "/bin/minetestserver") + "--gameid" "minetest" + "--config" #$(local-file "abdultest.conf")) + #:log-file (string-append %user-log-dir + "/minetest.log"))) + (stop #~(make-kill-destructor)) + (documentation "Start Minetest block game like Minecraft."))))) + +(define home-minetest-activation + (const #~(mkdir-p "/home/ctftilde/ctftilde-abdul/.local/minetest/abdultest"))) + +(define home-minetest-service-type + (service-type + (name 'home-minetest) + (extensions + (list (service-extension home-shepherd-service-type + home-minetest-services) + (service-extension home-activation-service-type + home-minetest-activation))) + (description "Minetest block game like Minecraft.") + (default-value #f))) + +(home-environment + (services + (list + (service home-bash-service-type + (home-bash-configuration + (bash-profile (list (plain-file + "bash_ps1" + "export PS1=\"\nā†“ā† $PS1\nā†’ \""))))) + + (service home-files-service-type + `((".guile" ,%default-dotguile))) + + (service home-minetest-service-type)))) +``` + +But this is no all, and I had advice to writing Minetest Server map config in a new file abdultest.conf. This is inside that + +``` +map-dir = /home/ctftilde/abdul/.local/minetest/abdultest +server_name = Abdul & friends +motd = I and mine friends build of blocks +port = 20030 +``` + +Then I use + +``` +#$(local-file "abdultest.conf") +``` + +to putting the file into Guix and it put an path to .conf file in Minetest Server command. (I had been said this helps because Guix can "declaratively" define the system) + +## Adding to Cron + +Services from .scm configuration file are runned by shepderd who is started when user logins. So yeah, I want a initial shepherd process starting when reboot and a Minetest Server process starting by shepherd then. For that I edit crontab like + +``` +crontab -e +``` + +and write line like + +``` +* * * * * bash -l +``` + +## Thanks + +I wanted to thank to Wojtek Kosior for helping me 2x to write Guix home configs and write cron configs. Thank you and you also for wanting to reading my blog. + +## Mine currently working + +I am now plan to using matterbridge software to connecting Matrix and Discord. I try to doing this similar to doing the Minetest Server and to using Guix Home functional package manager to doing that. + +=> /~abdul/index.gmi back into blog index -- cgit v1.2.3