Skip to content

Instantly share code, notes, and snippets.

@cleverca22
Created April 28, 2018 20:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cleverca22/136dfc7d28a5843cc5bb30b52040a251 to your computer and use it in GitHub Desktop.
Save cleverca22/136dfc7d28a5843cc5bb30b52040a251 to your computer and use it in GitHub Desktop.
{ ... }:
{
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 curl wget which
];
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