Skip to content

Instantly share code, notes, and snippets.

@pinpox
Created October 25, 2020 19:36
Show Gist options
  • Save pinpox/b4432ad827e1d796ff9450548e6b587d to your computer and use it in GitHub Desktop.
Save pinpox/b4432ad827e1d796ff9450548e6b587d to your computer and use it in GitHub Desktop.
systemd.services.sourcehut-meta = {
description = "meta.sr.ht website service";
requires = ["postgresql.service"];
after = [ "postgresql.service network.target" ];
environment = let
penv = pkgs.python.buildEnv.override {
extraLibs = [ pkgs.sourcehut.metasrht ] ;
};
in
{
PYTHONPATH = "${penv}/${pkgs.python.sitePackages}";
};
serviceConfig = {
Type = "simple";
User = "sourcehut";
Restart = "always";
ExecStart = ''${pkgs.python38Packages.gunicorn}/bin/gunicorn metasrht.app:app -b 127.0.0.1:5000'';
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment