update module

This commit is contained in:
Jonas Heinrich 2025-08-19 10:43:07 +02:00
parent ea1de563c9
commit c5c3dadc3c

View file

@ -21,37 +21,40 @@ in
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
# uWSGI configuration (nixos-25.05 uses `instance`, not `instances`) # global uwsgi settings (once)
services.uwsgi.enable = true; services.uwsgi = {
services.uwsgi.plugins = [ "python3" ]; enable = true;
services.uwsgi.instance."fragify" = { plugins = [ "python3" ];
type = "normal"; # run the emperor
chdir = "/"; instance = {
# WSGI entry from packaged share dir type = "emperor";
wsgi-file = "${pkgs.fragify}/share/fragify/fragify_wsgi.py"; vassals = {
module = "fragify:app"; fragify = {
# Socket type = "normal";
socket = "unix:${config.services.uwsgi.runDir}/fragify.sock"; chdir = "/";
"chmod-socket" = "660"; wsgi-file = "${pkgs.fragify}/share/fragify/fragify_wsgi.py";
umask = "0077"; module = "fragify:app";
vacuum = true; socket = "unix:${config.services.uwsgi.runDir}/fragify.sock";
master = true; "chmod-socket" = "660";
processes = 2; umask = "0077";
threads = 2; vacuum = true;
harakiri = 60; master = true;
"buffer-size" = 65535; processes = 2;
need-app = true; threads = 2;
"no-orphans" = true; harakiri = 60;
# Pass environment to the app "buffer-size" = 65535;
env = { need-app = true;
PYTHONPATH = "${pkgs.fragify.pythonPath}"; "no-orphans" = true;
FRAGIFY_TEMPLATES_DIR = "${pkgs.fragify}/share/fragify/templates"; env = {
FRAGIFY_STATIC_DIR = "${pkgs.fragify}/share/fragify/assets"; PYTHONPATH = "${pkgs.fragify.pythonPath}";
}; FRAGIFY_TEMPLATES_DIR = "${pkgs.fragify}/share/fragify/templates";
# Python deps for the embedded interpreter moved to PYTHONPATH in env FRAGIFY_STATIC_DIR = "${pkgs.fragify}/share/fragify/assets";
# Extra raw uWSGI settings not covered by module options };
settings = { settings = {
"static-map" = "/static=${pkgs.fragify}/share/fragify/assets"; "static-map" = "/static=${pkgs.fragify}/share/fragify/assets";
};
};
};
}; };
}; };