Fix various systemd configs
This commit is contained in:
parent
9bf0fea6f5
commit
04db7d3820
|
@ -19,28 +19,27 @@ in
|
|||
{
|
||||
config = {
|
||||
systemd.services.${name} = {
|
||||
enable = true;
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
description = "Foundryvtt server";
|
||||
preStart = ''
|
||||
mkdir -p ${dataDir}
|
||||
if [[ -f "${configFile}" ]]; then
|
||||
tempfile=$(mktemp)
|
||||
cp "${configFile}" "$tempfile"
|
||||
${pkgs.jq}/bin/jq ".[0] * .[1]" -s "$tempfile" "${declarativeConfigFile}" > "${configFile}"
|
||||
else
|
||||
cp "${declarativeConfigFile}" "${configFile}"
|
||||
fi
|
||||
if [[ ! -f "${stateDir}/app/resources/app/main.js" ]]; then
|
||||
echo "No ${name} app found. Please download zip from foundryvtt.com and extract to ${stateDir}/app"
|
||||
fi
|
||||
'';
|
||||
serviceConfig = {
|
||||
StateDirectory = "${name}";
|
||||
WorkingDirectory = stateDir;
|
||||
DynamicUser = true;
|
||||
Restart = "always";
|
||||
ExecStartPre = pkgs.writeShellScript "setup-foundry-vtt" ''
|
||||
uid
|
||||
mkdir -p ${stateDir}/app
|
||||
if [[ -f "${configFile}" ]]; then
|
||||
tempfile=$(mktemp)
|
||||
cp "${configFile}" "$tempfile"
|
||||
${pkgs.jq}/bin/jq ".[0] * .[1]" -s "$tempfile" "${declarativeConfigFile}" > "${configFile}"
|
||||
else
|
||||
cp "${declarativeConfigFile}" "${configFile}"
|
||||
fi
|
||||
if [[ ! -f "${stateDir}/app/resources/app/main.js" ]]; then
|
||||
echo "No ${name} app found. Please download zip from foundryvtt.com and extract to ${stateDir}/app"
|
||||
fi
|
||||
'';
|
||||
ExecStart = "${pkgs.nodejs}/bin/node ${stateDir}/app/resources/app/main.js --dataPath=${stateDir}/data";
|
||||
ExecStart = "${pkgs.nodejs}/bin/node ${stateDir}/app/resources/app/main.js --dataPath=\"${dataDir}\"";
|
||||
};
|
||||
};
|
||||
services = {
|
||||
|
|
|
@ -1,16 +1,17 @@
|
|||
{ pkgs, ... }: {
|
||||
{ pkgs, ... }:
|
||||
let
|
||||
serverPath = "/var/cache/gc-links/kassandra-server";
|
||||
in
|
||||
{
|
||||
systemd.services.kassandra = {
|
||||
enable = true;
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
description = "Kassandra Server";
|
||||
serviceConfig =
|
||||
let serverPath = "/var/cache/gc-links/kassandra-server";
|
||||
in
|
||||
{
|
||||
WorkingDirectory = serverPath;
|
||||
ExecStart = "${serverPath}/backend -b '::1' ";
|
||||
Restart = "always";
|
||||
Environment = "PATH=${pkgs.coreutils}/bin/:${pkgs.taskwarrior}/bin";
|
||||
User = "maralorn";
|
||||
};
|
||||
path = [ pkgs.coreutils pkgs.taskwarrior ];
|
||||
serviceConfig = {
|
||||
WorkingDirectory = serverPath;
|
||||
ExecStart = "${serverPath}/backend -b '::1' ";
|
||||
Restart = "always";
|
||||
User = "maralorn";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -90,12 +90,11 @@ in
|
|||
};
|
||||
environment.systemPackages = [ pkgs.laminar ];
|
||||
systemd.services.laminar = {
|
||||
enable = true;
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
description = "Laminar continuous integration service";
|
||||
serviceConfig = {
|
||||
WorkingDirectory = stateDir;
|
||||
ExecStart = "${pkgs.laminar}/bin/laminard";
|
||||
DynamicUser = false;
|
||||
User = "laminar";
|
||||
StateDirectory = "laminar";
|
||||
LimitNOFILE = "1024000";
|
||||
|
|
Loading…
Reference in a new issue