Fix various systemd configs
This commit is contained in:
parent
9bf0fea6f5
commit
04db7d3820
|
@ -19,28 +19,27 @@ in
|
||||||
{
|
{
|
||||||
config = {
|
config = {
|
||||||
systemd.services.${name} = {
|
systemd.services.${name} = {
|
||||||
enable = true;
|
wantedBy = [ "multi-user.target" ];
|
||||||
description = "Foundryvtt server";
|
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 = {
|
serviceConfig = {
|
||||||
StateDirectory = "${name}";
|
StateDirectory = "${name}";
|
||||||
WorkingDirectory = stateDir;
|
WorkingDirectory = stateDir;
|
||||||
DynamicUser = true;
|
DynamicUser = true;
|
||||||
Restart = "always";
|
Restart = "always";
|
||||||
ExecStartPre = pkgs.writeShellScript "setup-foundry-vtt" ''
|
ExecStart = "${pkgs.nodejs}/bin/node ${stateDir}/app/resources/app/main.js --dataPath=\"${dataDir}\"";
|
||||||
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";
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
services = {
|
services = {
|
||||||
|
|
|
@ -1,16 +1,17 @@
|
||||||
{ pkgs, ... }: {
|
{ pkgs, ... }:
|
||||||
|
let
|
||||||
|
serverPath = "/var/cache/gc-links/kassandra-server";
|
||||||
|
in
|
||||||
|
{
|
||||||
systemd.services.kassandra = {
|
systemd.services.kassandra = {
|
||||||
enable = true;
|
wantedBy = [ "multi-user.target" ];
|
||||||
description = "Kassandra Server";
|
description = "Kassandra Server";
|
||||||
serviceConfig =
|
path = [ pkgs.coreutils pkgs.taskwarrior ];
|
||||||
let serverPath = "/var/cache/gc-links/kassandra-server";
|
serviceConfig = {
|
||||||
in
|
WorkingDirectory = serverPath;
|
||||||
{
|
ExecStart = "${serverPath}/backend -b '::1' ";
|
||||||
WorkingDirectory = serverPath;
|
Restart = "always";
|
||||||
ExecStart = "${serverPath}/backend -b '::1' ";
|
User = "maralorn";
|
||||||
Restart = "always";
|
};
|
||||||
Environment = "PATH=${pkgs.coreutils}/bin/:${pkgs.taskwarrior}/bin";
|
|
||||||
User = "maralorn";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,12 +90,11 @@ in
|
||||||
};
|
};
|
||||||
environment.systemPackages = [ pkgs.laminar ];
|
environment.systemPackages = [ pkgs.laminar ];
|
||||||
systemd.services.laminar = {
|
systemd.services.laminar = {
|
||||||
enable = true;
|
wantedBy = [ "multi-user.target" ];
|
||||||
description = "Laminar continuous integration service";
|
description = "Laminar continuous integration service";
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
WorkingDirectory = stateDir;
|
WorkingDirectory = stateDir;
|
||||||
ExecStart = "${pkgs.laminar}/bin/laminard";
|
ExecStart = "${pkgs.laminar}/bin/laminard";
|
||||||
DynamicUser = false;
|
|
||||||
User = "laminar";
|
User = "laminar";
|
||||||
StateDirectory = "laminar";
|
StateDirectory = "laminar";
|
||||||
LimitNOFILE = "1024000";
|
LimitNOFILE = "1024000";
|
||||||
|
|
Loading…
Reference in a new issue