From e6ed60548397627bf10f561f9438201dbba0a36e Mon Sep 17 00:00:00 2001 From: Azat Bahawi Date: Sun, 21 Apr 2024 02:15:42 +0300 Subject: 2024-04-21 --- modules/nixos/games/minecraft.nix | 86 --------------------------------------- 1 file changed, 86 deletions(-) delete mode 100644 modules/nixos/games/minecraft.nix (limited to 'modules/nixos/games/minecraft.nix') diff --git a/modules/nixos/games/minecraft.nix b/modules/nixos/games/minecraft.nix deleted file mode 100644 index 6e163dc..0000000 --- a/modules/nixos/games/minecraft.nix +++ /dev/null @@ -1,86 +0,0 @@ -{ - config, - inputs, - lib, - pkgs, - ... -}: -with lib; -let - cfg = config.nixfiles.modules.games.minecraft; -in -{ - imports = [ inputs.minecraft.nixosModules.minecraft-servers ]; - - options.nixfiles.modules.games.minecraft = { - client.enable = mkEnableOption "Minecraft client"; - server = { - enable = mkEnableOption "Minecraft server"; - - port = mkOption { - description = "Server port."; - type = types.port; - default = 25565; - }; - - memory = mkOption { - description = "Amount of RAM to allocate."; - type = types.str; - default = "2G"; - }; - }; - }; - - config = mkMerge [ - (mkIf cfg.client.enable { hm.home.packages = [ pkgs.prismlauncher ]; }) - (mkIf cfg.server.enable { - nixfiles.modules.common.nix.allowedUnfreePackages = [ "minecraft-server" ]; - - ark.directories = [ config.services.minecraft-servers.dataDir ]; - - services.minecraft-servers = { - enable = true; - eula = true; - - openFirewall = true; - - servers.default = { - enable = true; - autoStart = true; - - package = pkgs.paperServers.paper-1_19_3; - - serverProperties = { - # motd = ""; - # white-list = true; - allow-flight = true; - difficulty = "hard"; - enable-command-block = true; - enforce-secure-profile = false; - enforce-whitelist = true; - gamemode = "survival"; - level-name = "default"; - max-players = 8; - online-mode = false; - previews-chat = false; - pvp = false; - server-port = cfg.server.port; - snooper-enabled = false; - }; - - jvmOpts = - (concatStringsSep " " [ - "-Xms${cfg.server.memory}" - "-Xmx${cfg.server.memory}" - "--add-modules=jdk.incubator.vector" # Required by some plugins. - ]) - + " "; - }; - }; - - nixpkgs.overlays = [ inputs.minecraft.overlay ]; - - my.extraGroups = [ config.services.minecraft-servers.group ]; - }) - ]; -} -- cgit 1.4.1