Add family minecraft servers
Some checks failed
/ check (push) Has been cancelled

This commit is contained in:
Daniel Flanagan 2024-10-03 09:23:44 -05:00
parent ce00bd6fed
commit 226c7993b1
4 changed files with 112 additions and 28 deletions

View file

@ -667,11 +667,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1721441897, "lastModified": 1726280639,
"narHash": "sha256-gYGX9/22tPNeF7dR6bWN5rsrpU4d06GnQNNgZ6ZiXz0=", "narHash": "sha256-YfLRPlFZWrT2oRLNAoqf7G3+NnUTDdlIJk6tmBU7kXM=",
"owner": "oxalica", "owner": "oxalica",
"repo": "rust-overlay", "repo": "rust-overlay",
"rev": "b7996075da11a2d441cfbf4e77c2939ce51506fd", "rev": "e9f8641c92f26fd1e076e705edb12147c384171d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -786,11 +786,11 @@
}, },
"locked": { "locked": {
"dir": "nix", "dir": "nix",
"lastModified": 1723525023, "lastModified": 1727585736,
"narHash": "sha256-ZsDJQSUokodwFMP4FIZm2dYojf5iC4F/EeKC5VuQlqY=", "narHash": "sha256-vEkcyKdFpfWbrtZlB5DCjNCmI2GudIJuHstWo3F9gL8=",
"owner": "wez", "owner": "wez",
"repo": "wezterm", "repo": "wezterm",
"rev": "30345b36d8a00fed347e4df5dadd83915a7693fb", "rev": "a2f2c07a29f5c98f6736cde0c86b24887f9fd48a",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -278,6 +278,8 @@
common common
podman podman
troubleshooting-tools troubleshooting-tools
virtual-machines
virtual-machines-gui
linux linux
fonts fonts
@ -298,6 +300,8 @@
password-manager password-manager
wifi wifi
graphical-workstation graphical-workstation
virtual-machines
virtual-machines-gui
music-production music-production
gaming gaming
slippi.nixosModules.default slippi.nixosModules.default
@ -393,6 +397,8 @@
kde-connect kde-connect
password-manager password-manager
graphical-workstation graphical-workstation
virtual-machines
virtual-machines-gui
laptop laptop
gaming gaming
@ -434,7 +440,7 @@
name = "battmode"; name = "battmode";
text = '' text = ''
command -v powerprofilesctl &>/dev/null && bash -x -c 'powerprofilesctl set power-saver' command -v powerprofilesctl &>/dev/null && bash -x -c 'powerprofilesctl set power-saver'
command -v swaymsg &>/dev/null && bash -x -c 'swaymsg output eDP-1 mode 2880x1920@120Hz' command -v swaymsg &>/dev/null && bash -x -c 'swaymsg output eDP-1 mode 2880x1920@60Hz'
''; '';
}) })
]; ];

View file

@ -872,6 +872,15 @@
}; };
}; };
virtual-machines = {pkgs, ...}: {
virtualisation.libvirtd.enable = true;
users.users.daniel.extraGroups = ["libvirtd"];
};
virtual-machines-gui = {pkgs, ...}: {
programs.virt-manager.enable = true;
};
postgres = {pkgs, ...}: { postgres = {pkgs, ...}: {
# this is really just for development usage # this is really just for development usage
services.postgresql = { services.postgresql = {

View file

@ -1108,28 +1108,91 @@ sudo nix run nixpkgs#ipmitool -- raw 0x30 0x30 0x02 0xff 0x00
]; ];
*/ */
} }
{ ({...}: let
port = 26969;
dir = "/storage/flanilla";
user = "flanilla";
uid = config.users.users.flanilla.uid;
gid = config.users.groups.flanilla.gid;
in {
# flanilla family minecraft server # flanilla family minecraft server
/* users.groups.${user} = {};
users.groups.flanilla = {}; users.users.${user} = {
users.users.flanilla = {
isSystemUser = true; isSystemUser = true;
createHome = false; createHome = false;
group = "flanilla"; group = user;
}; };
virtualisation.oci-containers.containers.minecraft-flanilla = { virtualisation.oci-containers.containers.minecraft-flanilla = {
autoStart = true; autoStart = true;
image = "docker.io/itzg/minecraft-server"; image = "docker.io/itzg/minecraft-server";
user = "${toString config.users.users.flanilla.uid}:${toString config.users.groups.flanilla.gid}"; user = "${toString uid}:${toString gid}";
extraOptions = ["--tty" "--interactive"]; extraOptions = ["--tty" "--interactive"];
environment = { environment = {
EULA = "true"; EULA = "true";
UID = toString config.users.users.flanilla.uid; UID = toString uid;
GID = toString config.users.groups.flanilla.gid; GID = toString gid;
STOP_SERVER_ANNOUNCE_DELAY = "20"; STOP_SERVER_ANNOUNCE_DELAY = "20";
TZ = "America/Chicago"; TZ = "America/Chicago";
VERSION = "1.20.4"; VERSION = "1.21";
OPS = "lytedev";
MODE = "survival";
DIFFICULTY = "easy";
ONLINE_MODE = "false";
MEMORY = "8G";
MAX_MEMORY = "16G";
ALLOW_FLIGHT = "true";
ENABLE_QUERY = "true";
ENABLE_COMMAND_BLOCK = "true";
};
ports = ["${toString port}:25565"];
volumes = [
"${dir}/data:/data"
"${dir}/worlds:/worlds"
];
};
systemd.tmpfiles.settings = {
"10-${user}-survival" = {
"${dir}" = {
"d" = {
mode = "0770";
user = user;
group = user;
};
};
};
};
services.restic.commonPaths = [dir];
networking.firewall.allowedTCPPorts = [
port
];
})
({...}: let
port = 26968;
dir = "/storage/flanilla-creative";
user = "flanilla";
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;
group = user;
};
virtualisation.oci-containers.containers.minecraft-flanilla-creative = {
autoStart = true;
image = "docker.io/itzg/minecraft-server";
user = "${toString uid}:${toString gid}";
extraOptions = ["--tty" "--interactive"];
environment = {
EULA = "true";
UID = toString uid;
GID = toString gid;
STOP_SERVER_ANNOUNCE_DELAY = "20";
TZ = "America/Chicago";
VERSION = "1.21";
OPS = "lytedev"; OPS = "lytedev";
MODE = "creative"; MODE = "creative";
DIFFICULTY = "peaceful"; DIFFICULTY = "peaceful";
@ -1140,23 +1203,29 @@ sudo nix run nixpkgs#ipmitool -- raw 0x30 0x30 0x02 0xff 0x00
ENABLE_QUERY = "true"; ENABLE_QUERY = "true";
ENABLE_COMMAND_BLOCK = "true"; ENABLE_COMMAND_BLOCK = "true";
}; };
ports = ["${toString port}:25565"];
environmentFiles = [
# config.sops.secrets."flanilla.env".path
];
ports = ["26966:25565"];
volumes = [ volumes = [
"/storage/flanilla/data:/data" "${dir}/data:/data"
"/storage/flanilla/worlds:/worlds" "${dir}/worlds:/worlds"
]; ];
}; };
systemd.tmpfiles.settings = {
"10-${user}-creative" = {
"${dir}" = {
"d" = {
mode = "0770";
user = user;
group = user;
};
};
};
};
services.restic.commonPaths = [dir];
networking.firewall.allowedTCPPorts = [ networking.firewall.allowedTCPPorts = [
26966 port
]; ];
*/ })
}
({options, ...}: let ({options, ...}: let
/* /*
toml = pkgs.formats.toml {}; toml = pkgs.formats.toml {};