Add misskey service
This commit is contained in:
parent
6300409df0
commit
52f2c07d3b
1 changed files with 33 additions and 2 deletions
|
@ -4,6 +4,12 @@
|
||||||
package = pkgs.postgresql_15;
|
package = pkgs.postgresql_15;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
services.redis.servers.misskey = {
|
||||||
|
port = 6379;
|
||||||
|
enable = true;
|
||||||
|
openFirewall = false;
|
||||||
|
};
|
||||||
|
|
||||||
security.acme = {
|
security.acme = {
|
||||||
acceptTerms = true;
|
acceptTerms = true;
|
||||||
defaults.email = "admin+acme@heartles.xyz";
|
defaults.email = "admin+acme@heartles.xyz";
|
||||||
|
@ -19,6 +25,10 @@
|
||||||
enable = true;
|
enable = true;
|
||||||
recommendedProxySettings = true;
|
recommendedProxySettings = true;
|
||||||
|
|
||||||
|
upstreams."misskey".extraConfig = ''
|
||||||
|
server unix:/var/run/misskey.sock;
|
||||||
|
'';
|
||||||
|
|
||||||
virtualHosts."egirls.gay" = {
|
virtualHosts."egirls.gay" = {
|
||||||
listen = [
|
listen = [
|
||||||
{
|
{
|
||||||
|
@ -36,7 +46,7 @@
|
||||||
useACMEHost = "egirls.gay";
|
useACMEHost = "egirls.gay";
|
||||||
locations."/" = {
|
locations."/" = {
|
||||||
proxyWebsockets = true;
|
proxyWebsockets = true;
|
||||||
proxyPass = "http://127.0.0.1:3000";
|
proxyPass = "http://misskey";
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
proxy_cache off;
|
proxy_cache off;
|
||||||
'';
|
'';
|
||||||
|
@ -44,7 +54,7 @@
|
||||||
|
|
||||||
locations."/api/drive/files/create" = {
|
locations."/api/drive/files/create" = {
|
||||||
proxyWebsockets = true;
|
proxyWebsockets = true;
|
||||||
proxyPass = "http://127.0.0.1:3000";
|
proxyPass = "http://misskey";
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
# increase max size and don't buffer file uploads
|
# increase max size and don't buffer file uploads
|
||||||
client_max_body_size 2g;
|
client_max_body_size 2g;
|
||||||
|
@ -66,6 +76,12 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
users.groups.misskey = { members = [ "jaina" ]; };
|
||||||
|
users.users.misskey = {
|
||||||
|
isSystemUser = true;
|
||||||
|
group = "misskey";
|
||||||
|
};
|
||||||
|
|
||||||
# todo: figure out how to get misskey to build in nix instead of requiring a manual build process
|
# todo: figure out how to get misskey to build in nix instead of requiring a manual build process
|
||||||
#
|
#
|
||||||
# pnpm2nix does not work due to misskey using workspaces
|
# pnpm2nix does not work due to misskey using workspaces
|
||||||
|
@ -81,4 +97,19 @@
|
||||||
CYPRESS_INSTALL_BINARY = "0";
|
CYPRESS_INSTALL_BINARY = "0";
|
||||||
CYPRESS_RUN_BINARY = "${pkgs.cypress}/bin/Cypress";
|
CYPRESS_RUN_BINARY = "${pkgs.cypress}/bin/Cypress";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
systemd.services.misskey = {
|
||||||
|
enable = true;
|
||||||
|
description = "Misskey daemon";
|
||||||
|
|
||||||
|
serviceConfig = {
|
||||||
|
Restart = "always";
|
||||||
|
StandardOutput = "syslog";
|
||||||
|
StandardError = "syslog";
|
||||||
|
Environment = "NODE_ENV=production";
|
||||||
|
WorkingDirectory = "/srv/misskey";
|
||||||
|
User = "misskey";
|
||||||
|
ExecStart = "pnpm migrateandrun";
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue