add wings

This commit is contained in:
zackartz 2024-05-03 18:13:08 -04:00
parent 5d8c281c7f
commit c88b244506
No known key found for this signature in database
GPG key ID: 5B53E53A9A514DBA

View file

@ -1,8 +1,25 @@
{
pkgs,
config,
lib,
...
}: {
}: let
wings = pkgs.stdenv.mkDerivation {
name = "wings";
src = pkgs.fetchurl {
name = "wings";
url = "https://github.com/pterodactyl/wings/releases/latest/download/wings_linux_amd64";
sha256 = lib.fakeSha256;
};
phases = ["installPhase"];
installPhase = ''
install -D $src $out/bin/wings
'';
};
in {
services.mysql = {
enable = true;
package = pkgs.mariadb;
@ -27,6 +44,26 @@
};
};
systemd.services."wings" = {
after = ["docker.service"];
requires = ["docker.service"];
partOf = ["docker.service"];
script = ''
${wings}/bin/wings
'';
wantedBy = ["multi-user.target"];
serviceConfig = {
User = "root";
WorkingDirectory = "/etc/pterodactyl";
LimitNOFILE = 4096;
PIDFile = /var/run/wings/daemon.pid;
Restart = "on-failure";
StartLimitInterval = 180;
StartLimitBurst = 30;
RestartSec = "5s";
};
};
systemd.services."p_queue-worker" = {
after = ["redis.service"];
wantedBy = ["multi-user.target"];
@ -71,6 +108,14 @@
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_redirect off;
proxy_buffering off;
proxy_request_buffering off;
'';
locations."~ /\\.ht".extraConfig = ''