summaryrefslogtreecommitdiff
path: root/ilex/uffd-service.nix
blob: 000220fafa05cf2751af11e5e1bd07decd58bd15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
{ config, lib, pkgs, ... }:

let
  uffd = pkgs.callPackage ./uffd.nix {};
in
{

  services.uwsgi = {
    enable = true;
    plugins = [ "python3" ];
    instance = {
      type = "normal";
      pythonPackages = self: with self; [ uffd ];
      module = "uffd:create_app()";
      # socket = "${config.services.uwsgi.runDir}/uwsgi.sock";
      http = ":8080";
      env = [
        "CONFIG_PATH=/tmp/uffd.conf"
        "FLASK_ENV=development"
      ];
      hook-pre-app = "exec:FLASK_APP=${uffd}/lib/python3.10/site-packages/uffd flask db upgrade";
    };
  };
}