added minecraft server

This commit is contained in:
2024-11-28 11:09:08 -06:00
parent ea597e8f6e
commit f0af39b19a
75 changed files with 221 additions and 69 deletions

View File

@@ -241,8 +241,8 @@
nh.enable = true;
ollama.enable = true;
homeassistant.enable = false;
minecraft.enable = true;
steam.enable = false;
@@ -261,6 +261,8 @@
nextcloud.enable = true;
gitlab.enable = true;
homeassistant.enable = false;
ntfy.enable = true;
};

View File

@@ -9,5 +9,6 @@
./pihole
./nextcloud
./ntfy
./homeassistant
];
}

View File

@@ -0,0 +1,26 @@
{ config, lib, ... }: {
options.sysconfig.opts.virtualization.homeassistant.enable = lib.mkOption {
type = lib.types.bool;
default = false;
};
config = lib.mkIf config.sysconfig.opts.virtualization.homeassistant.enable {
virtualisation.oci-containers = {
backend = "docker";
containers.homeassistant = {
volumes = [
"/ssd1/Home-Assistant/data:/config"
"/run/dbus:/run/dbus:ro"
];
environment.TZ = "America/Chicago";
image = "ghcr.io/home-assistant/home-assistant:stable"; # Warning: if the tag does not change, the image will not be updated
extraOptions = [
"--network=host"
#"--device=/dev/ttyACM0:/dev/ttyACM0" # Use this for external devices e.g. zigbee
];
};
};
};
}

View File

@@ -5,6 +5,6 @@
./openssh
./pipewire
./containers
./homeassistant
./minecraft
];
}

View File

@@ -1,31 +0,0 @@
{ config, lib, ... }: {
options.sysconfig.opts.homeassistant.enable = lib.mkOption {
type = lib.types.bool;
default = false;
};
config = lib.mkIf config.sysconfig.opts.homeassistant.enable {
services.home-assistant = {
enable = true;
configDir = "/ssd1/Home-Assistant/data";
extraComponents = [
"esphome"
"met"
"radio_browser"
"jellyfin"
"nextcloud"
"ollama"
"pi_hole"
];
config = {
default_config = {};
};
};
};
}

View File

@@ -0,0 +1,65 @@
{ config, lib, pkgs, inputs, ... }: {
options.sysconfig.opts.minecraft.enable = lib.options.mkOption {
type = lib.types.bool;
default = false;
};
imports = [
inputs.nix-minecraft.nixosModules.minecraft-servers
];
config = lib.mkIf config.sysconfig.opts.minecraft.enable {
nixpkgs.overlays = [ inputs.nix-minecraft.overlay ];
services.minecraft-servers = {
enable = true;
eula = true;
openFirewall = true;
dataDir = "/var/lib/mcservers";
servers = {
/*vanilla = {
enable = true;
package = pkgs.fabricServers.fabric;
serverProperties = {
server-port = 25566;
gamemode = "survival";
level-seed = "betterseed";
whitelist = true;
};
whitelist = {
"MeasureTwice66" = "a4032062-293d-484d-a790-9f52475836bb";
"651sonic" = "936a3fb0-4548-4557-975b-7794e97a3afc";
"Griffin12_" = "6a1f56d9-f712-4723-a031-e5437a389bb3";
};
autoStart = true;
};*/
modded = {
enable = true;
package = pkgs.fabricServers.fabric-1_21_1;
serverProperties = {
server-port = 25565;
gamemode = "survival";
level-seed = "betterseed";
white-list = true;
motd = "Didn't see that coming huh?";
};
whitelist = {
"MeasureTwice66" = "a4032062-293d-484d-a790-9f52475836bb";
"651sonic" = "936a3fb0-4548-4557-975b-7794e97a3afc";
"Griffin12_" = "6a1f56d9-f712-4723-a031-e5437a389bb3";
};
autoStart = true;
symlinks = {
mods = ./mods;
};
};
};
};
};
}