feat: add foundry-vtt
This commit is contained in:
@@ -46,8 +46,9 @@
|
|||||||
./modules/snapserver.nix
|
./modules/snapserver.nix
|
||||||
|
|
||||||
# gaming
|
# gaming
|
||||||
./modules/palworld.nix
|
# ./modules/palworld.nix
|
||||||
# ./modules/ark-survival-evolved.nix
|
# ./modules/ark-survival-evolved.nix
|
||||||
|
./modules/foundry-vtt.nix
|
||||||
|
|
||||||
# setup network
|
# setup network
|
||||||
./modules/setupnetwork.nix
|
./modules/setupnetwork.nix
|
||||||
|
|||||||
77
hosts/fw.cloonar.com/modules/foundry-vtt.nix
Normal file
77
hosts/fw.cloonar.com/modules/foundry-vtt.nix
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
{ config, pkgs, ... }:
|
||||||
|
let
|
||||||
|
foundry-vtt = pkgs.callPackage ../pkgs/foundry-vtt {};
|
||||||
|
cids = import ../modules/staticids.nix;
|
||||||
|
in {
|
||||||
|
users.users.foundry-vtt = {
|
||||||
|
isSystemUser = true;
|
||||||
|
uid = cids.uids.foundry-vtt;
|
||||||
|
home = "/var/lib/foundry-vtt";
|
||||||
|
group = "foundry-vtt";
|
||||||
|
createHome = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
users.groups.foundry-vtt = {
|
||||||
|
gid = cids.gids.foundry-vtt;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
containers.foundry-vtt = {
|
||||||
|
autoStart = true;
|
||||||
|
ephemeral = true;
|
||||||
|
privateNetwork = true;
|
||||||
|
hostBridge = "server";
|
||||||
|
hostAddress = "10.42.97.1";
|
||||||
|
localAddress = "10.42.97.21/24";
|
||||||
|
bindMounts = {
|
||||||
|
"/var/lib/foundry-vtt" = {
|
||||||
|
hostPath = "/var/lib/foundry-vtt";
|
||||||
|
isReadOnly = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
config = { lib, config, pkgs, ... }: {
|
||||||
|
networking = {
|
||||||
|
hostName = "foundry-vtt";
|
||||||
|
useHostResolvConf = false;
|
||||||
|
defaultGateway = {
|
||||||
|
address = "10.42.97.1";
|
||||||
|
interface = "eth0";
|
||||||
|
};
|
||||||
|
nameservers = [ "10.42.97.1" ];
|
||||||
|
};
|
||||||
|
systemd.services.foundry-vtt = {
|
||||||
|
description = "Foundry VTT Server";
|
||||||
|
after = [ "network.target" ];
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
environment = {
|
||||||
|
NODE_ENV = "production";
|
||||||
|
};
|
||||||
|
serviceConfig = {
|
||||||
|
ExecStart = "${pkgs.nodejs}/bin/node ${foundry-vtt}/share/foundry-vtt/resources/app/main.js --dataPath=${config.users.users.foundry-vtt.home}";
|
||||||
|
Restart = "always";
|
||||||
|
User = "foundry-vtt";
|
||||||
|
WorkingDirectory = "${config.users.users.foundry-vtt.home}";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
users.users.foundry-vtt = {
|
||||||
|
isSystemUser = true;
|
||||||
|
uid = cids.uids.foundry-vtt;
|
||||||
|
home = "/var/lib/foundry-vtt";
|
||||||
|
group = "foundry-vtt";
|
||||||
|
};
|
||||||
|
|
||||||
|
users.groups.foundry-vtt = {
|
||||||
|
gid = cids.gids.foundry-vtt;
|
||||||
|
};
|
||||||
|
|
||||||
|
networking.firewall = {
|
||||||
|
enable = true;
|
||||||
|
allowedTCPPorts = [ 30000 ];
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
system.stateVersion = "24.05";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -7,4 +7,13 @@
|
|||||||
proxyPass = "https://git.cloonar.com/";
|
proxyPass = "https://git.cloonar.com/";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
services.nginx.virtualHosts."foundry-vtt.cloonar.com" = {
|
||||||
|
forceSSL = true;
|
||||||
|
enableACME = true;
|
||||||
|
acmeRoot = null;
|
||||||
|
locations."/" = {
|
||||||
|
proxyPass = "http://10.42.97.21:30000";
|
||||||
|
proxyWebsockets = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
hosts/fw.cloonar.com/pkgs/foundry-vtt/FoundryVTT-12.331.zip
Normal file
BIN
hosts/fw.cloonar.com/pkgs/foundry-vtt/FoundryVTT-12.331.zip
Normal file
Binary file not shown.
25
hosts/fw.cloonar.com/pkgs/foundry-vtt/default.nix
Normal file
25
hosts/fw.cloonar.com/pkgs/foundry-vtt/default.nix
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
{ stdenv, lib, unzip }:
|
||||||
|
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
pname = "foundry-vtt";
|
||||||
|
version = "12.331";
|
||||||
|
|
||||||
|
src = ./FoundryVTT-12.331.zip;
|
||||||
|
|
||||||
|
nativeBuildInputs = [ unzip ];
|
||||||
|
|
||||||
|
unpackPhase = ''
|
||||||
|
unzip $src
|
||||||
|
'';
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out/share/foundry-vtt
|
||||||
|
cp -r . $out/share/foundry-vtt
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
description = "Tabletop simulator";
|
||||||
|
license = licenses.mit; # Adjust as needed
|
||||||
|
platforms = platforms.all;
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user