openttd: init service
This commit is contained in:
parent
79cce640d5
commit
77663c229f
|
@ -18,6 +18,7 @@
|
||||||
./programs/spotify
|
./programs/spotify
|
||||||
./programs/tmux
|
./programs/tmux
|
||||||
./programs/waybar.nix
|
./programs/waybar.nix
|
||||||
|
./services/openttd.nix
|
||||||
myneovim.homeManagerModules.default
|
myneovim.homeManagerModules.default
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -110,6 +111,7 @@
|
||||||
winetricks
|
winetricks
|
||||||
|
|
||||||
# Games
|
# Games
|
||||||
|
openttd
|
||||||
prismlauncher
|
prismlauncher
|
||||||
shattered-pixel-dungeon
|
shattered-pixel-dungeon
|
||||||
xonotic
|
xonotic
|
||||||
|
|
|
@ -127,6 +127,7 @@ in
|
||||||
443 # SSL
|
443 # SSL
|
||||||
6567 # Mindustry
|
6567 # Mindustry
|
||||||
80 # HTTP
|
80 # HTTP
|
||||||
|
3979 # OpenTTD
|
||||||
];
|
];
|
||||||
|
|
||||||
allowedUDPPorts = [
|
allowedUDPPorts = [
|
||||||
|
@ -135,6 +136,7 @@ in
|
||||||
28910 # Heretic II
|
28910 # Heretic II
|
||||||
6567 # Mindustry
|
6567 # Mindustry
|
||||||
8211 # Palworld
|
8211 # Palworld
|
||||||
|
3979 # OpenTTD
|
||||||
];
|
];
|
||||||
|
|
||||||
allowedTCPPortRanges = [
|
allowedTCPPortRanges = [
|
||||||
|
|
23
services/openttd.nix
Normal file
23
services/openttd.nix
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
{
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
openttd
|
||||||
|
];
|
||||||
|
|
||||||
|
systemd.user.services.openttd = {
|
||||||
|
Install.WantedBy = [ "default.target" ];
|
||||||
|
|
||||||
|
Unit.Description = "OpenTTD Tmux server";
|
||||||
|
|
||||||
|
Service = {
|
||||||
|
ExecStart = "${pkgs.tmux}/bin/tmux new -s OpenTTD -d '${pkgs.openttd}/bin/openttd -D'";
|
||||||
|
ExecStop = "${pkgs.tmux}/bin/tmux kill-server";
|
||||||
|
Restart = "on-failure";
|
||||||
|
Type = "forking";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue