mirror of
https://github.com/adrlau/nix-dotfiles.git
synced 2024-12-22 10:47:30 +01:00
added minecraft proxy
This commit is contained in:
parent
97ab291ffa
commit
2c424fc40a
@ -9,6 +9,7 @@
|
||||
./hardware-configuration.nix
|
||||
../../profiles/webhost.nix
|
||||
../../profiles/base.nix
|
||||
../../services/gate.nix
|
||||
./routes.nix
|
||||
];
|
||||
|
||||
|
44
services/gate.nix
Normal file
44
services/gate.nix
Normal file
@ -0,0 +1,44 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
mcPort = 25565;
|
||||
configurationFile = ''
|
||||
config:
|
||||
lite:
|
||||
enabled: true
|
||||
routes:
|
||||
- host: mc.256.no
|
||||
backend: 100.84.215.84:25565
|
||||
'';
|
||||
file = pkgs.writeText "gate.yaml" configurationFile;
|
||||
in
|
||||
{
|
||||
|
||||
networking.firewall.allowedTCPPorts = [ mcPort];
|
||||
networking.firewall.allowedUDPPorts = [ mcPort];
|
||||
|
||||
users.users.gate = {
|
||||
isSystemUser = true;
|
||||
description = "Gate Minecraft Proxy User";
|
||||
home = "/var/lib/gate";
|
||||
createHome = true;
|
||||
group = "gate";
|
||||
};
|
||||
|
||||
users.groups.gate = {
|
||||
};
|
||||
|
||||
systemd.services."gate" = {
|
||||
after = [ "network.target" ];
|
||||
wants = [ "network.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
||||
serviceConfig = {
|
||||
ExecStart = "${pkgs.gate}/bin/gate -c ${file}";
|
||||
User = "gate";
|
||||
Group = "gate";
|
||||
Restart = "on-failure";
|
||||
ProtectKernelModules = true;
|
||||
NoNewPrivileges = true;
|
||||
};
|
||||
};
|
||||
}
|
@ -1,8 +1,5 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
{
|
||||
environment.systemPackages = [
|
||||
pkgs.ollama
|
||||
];
|
||||
|
||||
services.minecraft-server = {
|
||||
enable = true;
|
||||
|
Loading…
Reference in New Issue
Block a user