update module

This commit is contained in:
Jonas Heinrich 2025-08-19 10:17:08 +02:00
parent 892fb25d06
commit 4fbf63bfaa

View file

@ -21,40 +21,39 @@ in
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
services.uwsgi = { # uWSGI configuration (nixos-25.05 uses `instance`, not `instances`)
enable = true; services.uwsgi.enable = true;
user = "fragify"; services.uwsgi.user = "fragify";
group = "fragify"; services.uwsgi.group = "fragify";
plugins = [ "python3" ]; services.uwsgi.plugins = [ "python3" ];
instances.fragify = { services.uwsgi.instance."fragify" = {
# Align with upstream module: put uwsgi options under settings type = "normal";
settings = { chdir = "/";
"chdir" = "/"; # WSGI entry from packaged share dir
"wsgi-file" = "${pkgs.fragify}/share/fragify/fragify_wsgi.py"; wsgi-file = "${pkgs.fragify}/share/fragify/fragify_wsgi.py";
module = "fragify:app"; module = "fragify:app";
# Socket # Socket
"socket" = "unix:${config.services.uwsgi.runDir}/fragify.sock"; socket = "unix:${config.services.uwsgi.runDir}/fragify.sock";
"chmod-socket" = "660"; "chmod-socket" = "660";
umask = "0077"; umask = "0077";
vacuum = true; vacuum = true;
master = true; master = true;
processes = 2; processes = 2;
threads = 2; threads = 2;
"harakiri" = 60; harakiri = 60;
"buffer-size" = 65535; "buffer-size" = 65535;
"need-app" = true; need-app = true;
"no-orphans" = true; "no-orphans" = true;
# Serve static files directly via uWSGI (optional) # Pass environment to the app
# Map /static to packaged assets directory (if present) env = {
"static-map" = "/static=${pkgs.fragify}/share/fragify/assets"; FRAGIFY_TEMPLATES_DIR = "${pkgs.fragify}/share/fragify/templates";
}; FRAGIFY_STATIC_DIR = "${pkgs.fragify}/share/fragify/assets";
# Environment for the WSGI app };
env = { # Python deps for the embedded interpreter
FRAGIFY_TEMPLATES_DIR = "${pkgs.fragify}/share/fragify/templates"; pythonPackages = p: with p; [ falcon requests jinja2 ];
FRAGIFY_STATIC_DIR = "${pkgs.fragify}/share/fragify/assets"; # Extra raw uWSGI settings not covered by module options
}; settings = {
# Python packages for uWSGI "static-map" = "/static=${pkgs.fragify}/share/fragify/assets";
pythonPackages = p: with p; [ falcon requests jinja2 ];
}; };
}; };