Skip to content

Commit

Permalink
Merge branch 'master' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
tgstation-server-ci[bot] committed Jan 27, 2025
2 parents 7868ee0 + 4e24216 commit e0eb59c
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions build/package/nix/tgstation-server.nix
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ in
};

production-appsettings = lib.mkOption {
type = lib.types.lines;
type = lib.types.path;
default = '''';
description = ''
The contents of appsettings.Production.yml in the /etc/tgstation-server.d directory.
A formatted appsettings.Production.yml file.
'';
};

Expand All @@ -91,6 +91,14 @@ in
Extra PATH entries to add to the TGS process
'';
};

environmentFile = lib.mkOption {
type = lib.types.nullOr lib.types.path;
default = null;
description = ''
Environment file as defined in {manpage}`systemd.exec(5)`
'';
};
};
};

Expand All @@ -111,7 +119,7 @@ in
mode = "0644";
};
"tgstation-server.d/appsettings.Production.yml" = {
text = cfg.production-appsettings;
source = cfg.production-appsettings;
group = cfg.groupname;
mode = "0640";
};
Expand All @@ -125,6 +133,7 @@ in
systemd.services.tgstation-server = {
description = "tgstation-server";
serviceConfig = {
EnvironmentFile = lib.mkIf (cfg.environmentFile != null) cfg.environmentFile;
User = cfg.username;
Type = "notify-reload";
NotifyAccess = "all";
Expand All @@ -138,7 +147,19 @@ in
WatchdogSignal = "SIGTERM";
LogsDirectory = "tgstation-server";
};
reloadTriggers = [
(lib.mkIf (cfg.environmentFile != null) [ cfg.environmentFile ])
"/etc/tgstation.server.d/appsettings.Production.yml"
];
restartIfChanged = false; # So that the TGS service doesn't just get restarted whenever it's updated, and boots players
wantedBy = [ "multi-user.target" ];
after = [
"network.target"
"mysql.service"
"mariadb.service"
"postgresql.service"
"mssql-server.service"
];
};
};
}

0 comments on commit e0eb59c

Please sign in to comment.