Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nix Updates #2095

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 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,6 +147,11 @@ 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" ];
};
};
Expand Down
Loading