-
-
Save cleverca22/deaf56e929355841310e9509fa3ddedd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ ... }: | |
{ | |
networking = { | |
nat = { | |
enable = true; | |
externalInterface = "enp3s0"; | |
externalIP = "192.168.2.11"; | |
forwardPorts = [ | |
{ sourcePort = 25565; destination = "192.168.3.3"; } | |
]; | |
internalIPs = [ "192.168.3.3/32" ]; | |
}; | |
}; | |
containers.mc1 = { | |
autoStart = true; | |
privateNetwork = true; | |
hostAddress = "192.168.3.2"; | |
localAddress = "192.168.3.3"; | |
config = { config, pkgs, ... }: { | |
environment.systemPackages = with pkgs; [ | |
jdk8 screen | |
]; | |
networking = { | |
firewall.allowedTCPPorts = [ 25565 ]; | |
hostName = "mc1.example.ca"; | |
}; | |
users.extraUsers.mc1 = { | |
isNormalUser = true; | |
uid = 1020; | |
}; | |
services = { | |
openssh = { | |
enable = true; | |
permitRootLogin = "yes"; | |
}; | |
}; | |
}; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment