nixos/modules/server/game/minecraft/default.nix

45 lines
1.6 KiB
Nix
Raw Normal View History

2025-01-07 18:51:53 +04:00
{ config, lib, inputs, pkgs, ... }:
with lib;
let cfg = config.void.server.game.minecraft;
in {
2025-01-07 19:00:31 +04:00
imports = [ inputs.nix-minecraft.nixosModules.minecraft-servers ];
2025-01-07 18:58:00 +04:00
options.void.server.game.minecraft = { enable = mkEnableOption false; };
2025-01-07 18:51:53 +04:00
config = mkIf cfg.enable {
2025-01-07 18:55:40 +04:00
nixpkgs = {
overlays = [ inputs.nix-minecraft.overlay ];
config.allowUnfreePredicate = pkg:
builtins.elem (lib.getName pkgs) [ "minecraft-server" ];
};
2025-01-07 18:51:53 +04:00
services = {
2025-01-07 19:06:35 +04:00
inputs.nix-minecraft.nixosModules.minecraft-servers.servers.wires =
2025-01-07 18:51:53 +04:00
let modpack = pkgs.fetchPackwizModpack { url = ./sakopack; };
in {
enable = true;
2025-01-07 18:55:40 +04:00
# HAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHHAAHAHHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAH
eula = true;
openFirewall = true;
2025-01-07 19:09:28 +04:00
package = pkgs.fabricServers.fabric-1_24_4.override {
2025-01-07 18:51:53 +04:00
loaderVersion = "0.16.9";
};
2025-01-07 18:57:17 +04:00
whitelist = { Sakoooo = "6b05caca-3d78-4597-aba5-d0f816f94024"; };
2025-01-07 18:55:40 +04:00
serverProperties = {
white-list = true;
difficulty = "normal";
server-port = 25568;
gamemode = "survival";
};
2025-01-07 18:51:53 +04:00
symlinks = { "mods" = "${modpack}/mods"; };
# files = {
# "config" = "${modpack}/config";
# "config/mod1.yml" = "${modpack}/config/mod1.yml";
# "config/mod2.conf" = "${modpack}/config/mod2.conf";
# # You can add files not on the modpack, of course
# "config/server-specific.conf".value = { example = "foo-bar"; };
# };
};
};
};
}