forked from Zynh0722/permafrost
foundry: include unit
This commit is contained in:
parent
bf2805b1a7
commit
c6c76c488c
1 changed files with 27 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
||||||
{ lib, config, ... }:
|
{ lib, config, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.permafrost.foundry;
|
cfg = config.permafrost.foundry;
|
||||||
|
@ -13,6 +13,32 @@ in
|
||||||
{
|
{
|
||||||
permafrost.nginx.enable = lib.mkDefault true;
|
permafrost.nginx.enable = lib.mkDefault true;
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
users.groups.foundry = { };
|
||||||
|
users.users.foundry = {
|
||||||
|
group = "foundry";
|
||||||
|
isSystemUser = true;
|
||||||
|
description = "foundryvtt user";
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.services.foundry =
|
||||||
|
let
|
||||||
|
mainPath = "/home/foundry/foundryvtt/resources/app/main.js";
|
||||||
|
dataPath = "/home/foundry/foundrydata";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
description = "foundryvtt service";
|
||||||
|
enable = true;
|
||||||
|
after = [ "network.target" ];
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
serviceConfig = {
|
||||||
|
User = "foundry";
|
||||||
|
Restart = "always";
|
||||||
|
WorkingDirectory = "/home/foundry/foundryvtt";
|
||||||
|
ExecStart = "${lib.getExe pkgs.nodejs_20} ${mainPath} --dataPath=${dataPath}";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
{
|
{
|
||||||
services.nginx.virtualHosts."scarlet.zynh.me" = {
|
services.nginx.virtualHosts."scarlet.zynh.me" = {
|
||||||
serverName = "scarlet.zynh.me";
|
serverName = "scarlet.zynh.me";
|
||||||
|
|
Loading…
Reference in a new issue