fix(home-manager): move openttd service to desktop
This commit is contained in:
parent
49ca0fa78b
commit
550344240a
2 changed files with 1 additions and 1 deletions
|
@ -8,7 +8,7 @@
|
|||
# Import configurations for better modularity.
|
||||
imports = [
|
||||
../../modules/home-manager
|
||||
../../modules/home-manager/services.nix
|
||||
./services/openttd.nix
|
||||
];
|
||||
|
||||
# Home Manager needs a bit of information about you and the paths it should
|
||||
|
|
53
specific/desktop/services/openttd.nix
Normal file
53
specific/desktop/services/openttd.nix
Normal 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 new -s OpenTTD -d '${pkgs.openttd}/bin/openttd -g /home/wizardlink/.local/share/openttd/save/hyfy.sav -D'";
|
||||
ExecStop = "${pkgs.tmux}/bin/tmux kill-server";
|
||||
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 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 send-keys -t OpenTTD 'save hyfy' Enter";
|
||||
Type = "simple";
|
||||
Restart = "always";
|
||||
RestartSec = "1800s";
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue