VEGAS: quick-and-dirty minecraft server
This commit is contained in:
parent
85ce0e7511
commit
9e284cee3f
1 changed files with 30 additions and 0 deletions
|
@ -71,4 +71,34 @@
|
|||
"systemd-journald@.socket"
|
||||
"systemd-journald-varlink@.socket"
|
||||
];
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
services.minecraft-server = let
|
||||
modpack = fetchTarball {
|
||||
url = "https://bafybeiar4mnqvbwkb4glerj6yibccgscbff7nzeojf6px3oapxn7f7hymq.ipfs.privatevoid.net/modpack.tar.gz";
|
||||
sha256 = "sha256:1iqd6mlknbq4r3iqpfsibp8h2kknaaqkqarnw03z2s61ivsqq7lc";
|
||||
};
|
||||
in {
|
||||
enable = true;
|
||||
eula = true;
|
||||
openFirewall = true;
|
||||
package = pkgs.minecraft-server.overrideAttrs (_: {
|
||||
version = "forge-1.12.2";
|
||||
src = "${modpack}/forge-1.12.2-14.23.5.2796-universal.jar"; # HACK
|
||||
});
|
||||
};
|
||||
systemd.services.minecraft-server.path = [ pkgs.jre8 ];
|
||||
systemd.services.minecraft-server.serviceConfig = {
|
||||
ExecStart = lib.mkForce "/var/lib/minecraft/start.sh";
|
||||
};
|
||||
|
||||
users.users.minecraft.group = "minecraft-sftp";
|
||||
users.groups.minecraft-sftp = {};
|
||||
services.openssh.extraConfig = ''
|
||||
Match Group minecraft-sftp
|
||||
ChrootDirectory /srv/minecraft-cc-sftp
|
||||
ForceCommand internal-sftp -u 0002
|
||||
AllowTcpForwarding no
|
||||
X11Forwarding no
|
||||
'';
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue