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

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
mods/

156
flake.lock generated
View File

@@ -274,6 +274,22 @@
}
},
"flake-compat_3": {
"flake": false,
"locked": {
"lastModified": 1673956053,
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_4": {
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
@@ -287,7 +303,7 @@
"url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz"
}
},
"flake-compat_4": {
"flake-compat_5": {
"flake": false,
"locked": {
"lastModified": 1696426674,
@@ -422,6 +438,24 @@
"inputs": {
"systems": "systems_4"
},
"locked": {
"lastModified": 1681202837,
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "cfacdce06f30d2b68473a46042957675eebb3401",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_4": {
"inputs": {
"systems": "systems_5"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
@@ -900,9 +934,9 @@
"hyprlang": "hyprlang_2",
"hyprutils": "hyprutils_2",
"hyprwayland-scanner": "hyprwayland-scanner_2",
"nixpkgs": "nixpkgs_11",
"nixpkgs": "nixpkgs_12",
"pre-commit-hooks": "pre-commit-hooks_2",
"systems": "systems_5",
"systems": "systems_6",
"xdph": "xdph_2"
},
"locked": {
@@ -1210,11 +1244,11 @@
"locked": {
"lastModified": 1,
"narHash": "sha256-Hripi5dnBGegbRPwCt1+a3oH6b1AQxEoJXodiLE8KKw=",
"path": "/nix/store/wxq3cg9kq18xfd5q2p760xl3g0gsqnwi-source/home-manager",
"path": "/nix/store/7as6frhriqca7a04y6qlg884cb45xj71-source/home-manager",
"type": "path"
},
"original": {
"path": "/nix/store/wxq3cg9kq18xfd5q2p760xl3g0gsqnwi-source/home-manager",
"path": "/nix/store/7as6frhriqca7a04y6qlg884cb45xj71-source/home-manager",
"type": "path"
}
},
@@ -1264,6 +1298,26 @@
"type": "github"
}
},
"nix-minecraft": {
"inputs": {
"flake-compat": "flake-compat_3",
"flake-utils": "flake-utils_3",
"nixpkgs": "nixpkgs_8"
},
"locked": {
"lastModified": 1732672456,
"narHash": "sha256-A79pwUWY4/LFNrKpbkJUeL9hC2o1U1GmcBL6LYx7I0c=",
"owner": "Infinidoge",
"repo": "nix-minecraft",
"rev": "e5fc40d37086cb7e4f8516cd2b4b88c6edc70398",
"type": "github"
},
"original": {
"owner": "Infinidoge",
"repo": "nix-minecraft",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1731797254,
@@ -1369,6 +1423,22 @@
}
},
"nixpkgs_10": {
"locked": {
"lastModified": 1731676054,
"narHash": "sha256-OZiZ3m8SCMfh3B6bfGC/Bm4x3qc1m2SVEAlkV6iY7Yg=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "5e4fbfb6b3de1aa2872b76d49fafc942626e2add",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_11": {
"locked": {
"lastModified": 1731676054,
"narHash": "sha256-OZiZ3m8SCMfh3B6bfGC/Bm4x3qc1m2SVEAlkV6iY7Yg=",
@@ -1384,7 +1454,7 @@
"type": "github"
}
},
"nixpkgs_11": {
"nixpkgs_12": {
"locked": {
"lastModified": 1731676054,
"narHash": "sha256-OZiZ3m8SCMfh3B6bfGC/Bm4x3qc1m2SVEAlkV6iY7Yg=",
@@ -1497,6 +1567,22 @@
}
},
"nixpkgs_8": {
"locked": {
"lastModified": 1715266358,
"narHash": "sha256-doPgfj+7FFe9rfzWo1siAV2mVCasW+Bh8I1cToAXEE4=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "f1010e0469db743d14519a1efd37e23f8513d714",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_9": {
"locked": {
"lastModified": 1731797254,
"narHash": "sha256-df3dJApLPhd11AlueuoN0Q4fHo/hagP75LlM5K1sz9g=",
@@ -1512,22 +1598,6 @@
"type": "github"
}
},
"nixpkgs_9": {
"locked": {
"lastModified": 1731676054,
"narHash": "sha256-OZiZ3m8SCMfh3B6bfGC/Bm4x3qc1m2SVEAlkV6iY7Yg=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "5e4fbfb6b3de1aa2872b76d49fafc942626e2add",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixvim": {
"inputs": {
"flake-parts": "flake-parts",
@@ -1577,7 +1647,7 @@
"nixvim_3": {
"inputs": {
"flake-parts": "flake-parts_3",
"nixpkgs": "nixpkgs_9",
"nixpkgs": "nixpkgs_10",
"nixvim": "nixvim_4"
},
"locked": {
@@ -1597,12 +1667,12 @@
"nixvim_4": {
"inputs": {
"devshell": "devshell_2",
"flake-compat": "flake-compat_3",
"flake-compat": "flake-compat_4",
"flake-parts": "flake-parts_4",
"git-hooks": "git-hooks_2",
"home-manager": "home-manager_4",
"nix-darwin": "nix-darwin_2",
"nixpkgs": "nixpkgs_10",
"nixpkgs": "nixpkgs_11",
"nuschtosSearch": "nuschtosSearch_2",
"treefmt-nix": "treefmt-nix_2"
},
@@ -1648,7 +1718,7 @@
},
"nuschtosSearch_2": {
"inputs": {
"flake-utils": "flake-utils_3",
"flake-utils": "flake-utils_4",
"ixx": "ixx_2",
"nixpkgs": [
"nixvim",
@@ -1715,7 +1785,7 @@
},
"pre-commit-hooks_2": {
"inputs": {
"flake-compat": "flake-compat_4",
"flake-compat": "flake-compat_5",
"gitignore": "gitignore_4",
"nixpkgs": [
"system",
@@ -1766,11 +1836,11 @@
"locked": {
"lastModified": 1,
"narHash": "sha256-QahOuoQdXshu38W5uO7hLhG/yFkT7S2l8Dxicq0wdGk=",
"path": "/nix/store/lw4k0khy5i7wx0jcahbhvq1b2d2pmk3m-source/programs",
"path": "/nix/store/knc49ci8cp75177wlx99z35lgsrxfgcm-source/programs",
"type": "path"
},
"original": {
"path": "/nix/store/lw4k0khy5i7wx0jcahbhvq1b2d2pmk3m-source/programs",
"path": "/nix/store/knc49ci8cp75177wlx99z35lgsrxfgcm-source/programs",
"type": "path"
}
},
@@ -1825,7 +1895,8 @@
"home-manager": "home-manager",
"impermanence": "impermanence",
"nathan": "nathan",
"nixpkgs": "nixpkgs_8",
"nix-minecraft": "nix-minecraft",
"nixpkgs": "nixpkgs_9",
"nixvim": "nixvim_3",
"sops-nix": "sops-nix",
"system": "system"
@@ -1838,11 +1909,11 @@
"locked": {
"lastModified": 1,
"narHash": "sha256-0Ztx5DVQ2I7hvCK/qjGa4XTdRgbzM8rhf19m0al8lVM=",
"path": "/nix/store/lw4k0khy5i7wx0jcahbhvq1b2d2pmk3m-source/services/sddm",
"path": "/nix/store/knc49ci8cp75177wlx99z35lgsrxfgcm-source/services/sddm",
"type": "path"
},
"original": {
"path": "/nix/store/lw4k0khy5i7wx0jcahbhvq1b2d2pmk3m-source/services/sddm",
"path": "/nix/store/knc49ci8cp75177wlx99z35lgsrxfgcm-source/services/sddm",
"type": "path"
}
},
@@ -1873,12 +1944,12 @@
},
"locked": {
"lastModified": 1,
"narHash": "sha256-aOVRQVw4ske+yp25MVXijztq8NDAmxv6ZER0g5myumo=",
"path": "/nix/store/wxq3cg9kq18xfd5q2p760xl3g0gsqnwi-source/system-config",
"narHash": "sha256-3/fqVrpyXItqSHfYomdottne6Q2q+0dPCGk8JZeEQ0k=",
"path": "/nix/store/7as6frhriqca7a04y6qlg884cb45xj71-source/system-config",
"type": "path"
},
"original": {
"path": "/nix/store/wxq3cg9kq18xfd5q2p760xl3g0gsqnwi-source/system-config",
"path": "/nix/store/7as6frhriqca7a04y6qlg884cb45xj71-source/system-config",
"type": "path"
}
},
@@ -1943,6 +2014,21 @@
}
},
"systems_5": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_6": {
"locked": {
"lastModified": 1689347949,
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",

View File

@@ -26,6 +26,8 @@
inputs.nixpkgs.follows = "nixpkgs";
};
nix-minecraft.url = "github:Infinidoge/nix-minecraft";
#simple-nixos-mailserver.url = "gitlab:simple-nixos-mailserver/nixos-mailserver/nixos-24.05";
system.url = "./system-config";

View File

@@ -242,7 +242,7 @@
ollama.enable = true;
homeassistant.enable = false;
minecraft.enable = true;
steam.enable = false;
@@ -262,6 +262,8 @@
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;
};
};
};
};
};
}