refactor!: restructure and document configuration

This commit is contained in:
Alexandre Cavalheiro S. Tiago da Silva 2025-03-06 05:30:47 -03:00
parent 4a02e072a7
commit f87f9995be
Signed by: wizardlink
GPG key ID: A5767B54367CFBDF
126 changed files with 957 additions and 590 deletions

View file

@ -0,0 +1,53 @@
{
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 -L openttd new -s OpenTTD -d '${pkgs.openttd}/bin/openttd -g /home/wizardlink/.local/share/openttd/save/hyfy.sav -D'";
ExecStop = "${pkgs.tmux}/bin/tmux kill-session -t OpenTTD";
Restart = "on-failure";
Type = "forking";
};
};
systemd.user.services.openttd-rcon = {
Install.WantedBy = [ "default.target" ];
Unit = {
Description = "OpenTTD RCON Password set";
After = [ "openttd.service" ];
};
Service = {
ExecStart = "${pkgs.tmux}/bin/tmux -L openttd send-keys -t OpenTTD 'rcon_pw aaaa' Enter";
Type = "oneshot";
};
};
systemd.user.services.openttd-save = {
Install.WantedBy = [ "default.target" ];
Unit = {
Description = "OpenTTD RCON Password set";
After = [ "openttd.service" ];
};
Service = {
ExecStart = "${pkgs.tmux}/bin/tmux -L openttd send-keys -t OpenTTD 'save hyfy' Enter";
Type = "simple";
Restart = "always";
RestartSec = "1800s";
};
};
}