migrate minecraft to container
This commit is contained in:
		
							parent
							
								
									47bae37e86
								
							
						
					
					
						commit
						4020891021
					
				
					 2 changed files with 19 additions and 24 deletions
				
			
		
							
								
								
									
										19
									
								
								nixos/viridian/containers/minecraft.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								nixos/viridian/containers/minecraft.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,19 @@
 | 
			
		|||
{ ... }:
 | 
			
		||||
 | 
			
		||||
{
 | 
			
		||||
  virtualisation.oci-containers.containers = {
 | 
			
		||||
    minecraft = {
 | 
			
		||||
      autoStart = true;
 | 
			
		||||
      image = "itzg/minecraft-server";
 | 
			
		||||
      ports = [
 | 
			
		||||
        "25565:25565"
 | 
			
		||||
      ];
 | 
			
		||||
      volumes = [
 | 
			
		||||
        "/srv/containers/minecraft:/data:rw"
 | 
			
		||||
      ];
 | 
			
		||||
      environment = {
 | 
			
		||||
        EULA = "true";
 | 
			
		||||
      };
 | 
			
		||||
    };
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -1,24 +0,0 @@
 | 
			
		|||
{ pkgs, ... }:
 | 
			
		||||
 | 
			
		||||
{
 | 
			
		||||
  # Sandbox game developed by Mojang Studios
 | 
			
		||||
  services.minecraft-server = {
 | 
			
		||||
    enable = true;
 | 
			
		||||
    package = pkgs.unstable.minecraft-server;
 | 
			
		||||
    openFirewall = true;
 | 
			
		||||
    dataDir = "/var/lib/minecraft";
 | 
			
		||||
    declarative = true;
 | 
			
		||||
    serverProperties = {
 | 
			
		||||
      gamemode = "survival";
 | 
			
		||||
      level-name = "kanto.dev";
 | 
			
		||||
      difficulty = "easy";
 | 
			
		||||
      server-port = 25565;
 | 
			
		||||
      motd = "Welcome to our little private place!";
 | 
			
		||||
    };
 | 
			
		||||
    eula = true;
 | 
			
		||||
  };
 | 
			
		||||
  environment.persistence."/persist" = {
 | 
			
		||||
    directories = [ "/var/lib/minecraft" ];
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue