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