Fix minecraft server so saving works
Some checks failed
/ check (push) Failing after 3m0s

This commit is contained in:
Daniel Flanagan 2024-10-10 11:46:03 -05:00
parent 2b4b1c5850
commit 303ca8c871
3 changed files with 29 additions and 12 deletions

View file

@ -407,6 +407,7 @@
virtual-machines-gui
laptop
gaming
cross-compiler
./nixos/foxtrot.nix

View file

@ -351,6 +351,10 @@
};
};
cross-compiler = {config, ...}: {
boot.binfmt.emulatedSystems = ["aarch64-linux"];
};
default-nix-configuration-and-overlays = {
lib,
config,
@ -362,7 +366,7 @@
modifications
unstable-packages
];
# config.allowUnfree = true;
config.allowUnfree = true;
};
nix = {
@ -373,6 +377,8 @@
trusted-users = ["root" "daniel"];
experimental-features = lib.mkDefault ["nix-command" "flakes"];
extra-platforms = ["aarch64-linux"];
substituters = [
# TODO: dedupe with flake's config? is that even necessary?
"https://cache.nixos.org/"

View file

@ -1112,26 +1112,27 @@ sudo nix run nixpkgs#ipmitool -- raw 0x30 0x30 0x02 0xff 0x00
port = 26969;
dir = "/storage/flanilla";
user = "flanilla";
uid = config.users.users.flanilla.uid;
gid = config.users.groups.flanilla.gid;
# uid = config.users.users.flanilla.uid;
# gid = config.users.groups.flanilla.gid;
in {
# flanilla family minecraft server
users.groups.${user} = {};
users.users.${user} = {
isSystemUser = true;
createHome = false;
home = dir;
group = user;
};
virtualisation.oci-containers.containers.minecraft-flanilla = {
autoStart = true;
autoStart = false;
image = "docker.io/itzg/minecraft-server";
user = "${toString uid}:${toString gid}";
# user = "${toString uid}:${toString gid}";
extraOptions = ["--tty" "--interactive"];
environment = {
EULA = "true";
MOTD = "Flanilla Survival! Happy hunting!";
UID = toString uid;
GID = toString gid;
# UID = toString uid;
# GID = toString gid;
STOP_SERVER_ANNOUNCE_DELAY = "20";
TZ = "America/Chicago";
VERSION = "1.21";
@ -1152,6 +1153,10 @@ sudo nix run nixpkgs#ipmitool -- raw 0x30 0x30 0x02 0xff 0x00
"${dir}/worlds:/worlds"
];
};
systemd.services.podman-minecraft-flanilla.serviceConfig = {
User = user;
Group = user;
};
systemd.tmpfiles.settings = {
"10-${user}-survival" = {
"${dir}/data" = {
@ -1179,26 +1184,27 @@ sudo nix run nixpkgs#ipmitool -- raw 0x30 0x30 0x02 0xff 0x00
port = 26968;
dir = "/storage/flanilla-creative";
user = "flanilla";
uid = config.users.users.flanilla.uid;
gid = config.users.groups.flanilla.gid;
# uid = config.users.users.flanilla.uid;
# gid = config.users.groups.flanilla.gid;
in {
# flanilla family minecraft server
users.groups.${user} = {};
users.users.${user} = {
isSystemUser = true;
createHome = false;
home = lib.mkForce dir;
group = user;
};
virtualisation.oci-containers.containers.minecraft-flanilla-creative = {
autoStart = true;
image = "docker.io/itzg/minecraft-server";
user = "${toString uid}:${toString gid}";
# user = "${toString uid}:${toString gid}";
extraOptions = ["--tty" "--interactive"];
environment = {
EULA = "true";
MOTD = "Flanilla Creative! Have fun building!";
UID = toString uid;
GID = toString gid;
# UID = toString uid;
# GID = toString gid;
STOP_SERVER_ANNOUNCE_DELAY = "20";
TZ = "America/Chicago";
VERSION = "1.21";
@ -1219,6 +1225,10 @@ sudo nix run nixpkgs#ipmitool -- raw 0x30 0x30 0x02 0xff 0x00
"${dir}/worlds:/worlds"
];
};
# systemd.services.podman-minecraft-flanilla-creative.serviceConfig = {
# User = user;
# Group = user;
# };
systemd.tmpfiles.settings = {
"10-${user}-creative" = {
"${dir}/data" = {