update module
This commit is contained in:
parent
ea1de563c9
commit
c5c3dadc3c
1 changed files with 34 additions and 31 deletions
21
module.nix
21
module.nix
|
|
@ -21,16 +21,19 @@ 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" ];
|
||||||
|
# run the emperor
|
||||||
|
instance = {
|
||||||
|
type = "emperor";
|
||||||
|
vassals = {
|
||||||
|
fragify = {
|
||||||
type = "normal";
|
type = "normal";
|
||||||
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 = "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";
|
||||||
|
|
@ -42,18 +45,18 @@ in
|
||||||
"buffer-size" = 65535;
|
"buffer-size" = 65535;
|
||||||
need-app = true;
|
need-app = true;
|
||||||
"no-orphans" = true;
|
"no-orphans" = true;
|
||||||
# Pass environment to the app
|
|
||||||
env = {
|
env = {
|
||||||
PYTHONPATH = "${pkgs.fragify.pythonPath}";
|
PYTHONPATH = "${pkgs.fragify.pythonPath}";
|
||||||
FRAGIFY_TEMPLATES_DIR = "${pkgs.fragify}/share/fragify/templates";
|
FRAGIFY_TEMPLATES_DIR = "${pkgs.fragify}/share/fragify/templates";
|
||||||
FRAGIFY_STATIC_DIR = "${pkgs.fragify}/share/fragify/assets";
|
FRAGIFY_STATIC_DIR = "${pkgs.fragify}/share/fragify/assets";
|
||||||
};
|
};
|
||||||
# Python deps for the embedded interpreter moved to PYTHONPATH in env
|
|
||||||
# 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";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
# Ensure fragify user and group exist
|
# Ensure fragify user and group exist
|
||||||
users.users.fragify = {
|
users.users.fragify = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue