{ config, pkgs, lib, mkDomain, ... }: { # trivial gradios /** / systemd.services.trivial-gradios-heritage-graph = { description = pkgs.python3Packages.trivial-gradios.meta.description; after = [ "network.target" ]; wantedBy = [ "multi-user.target" ]; serviceConfig = rec { User = "trivial-gradios"; Group = "trivial-gradios"; DynamicUser = true; StateDirectory = "trivial-gradios-heritage-graph"; WorkingDirectory = "/var/lib/${StateDirectory}"; ExecStart = "${pkgs.python3Packages.trivial-gradios}/bin/trivial-gradios-heritage-graph --port 37001"; Restart = "on-failure"; }; }; services.nginx.virtualHosts.${mkDomain "gradio"} = { forceSSL = true; # addSSL = true; enableACME = true; #useACMEHost = acmeDomain; locations."/" = { root = pkgs.writeTextDir "index.html" ''
name description
heritage-graph A simple tool to greate a directed ancestry graph.
''; }; locations."/heritage-graph/" = { proxyPass = "http://127.0.0.1:37001"; proxyWebsockets = true; extraConfig = '' rewrite ^/heritage-graph(/.*)$ $1 break; ''; }; }; /**/ }