depot/hosts/prophet/services/reflex/default.nix

25 lines
607 B
Nix
Raw Normal View History

2022-01-30 21:28:16 +02:00
{ config, pkgs, tools, ... }:
let
py3 = pkgs.python3.withPackages (ps: with ps; [
requests
requests-unixsocket
]);
port = config.portsStr.nixIpfs;
in {
reservePortsFor = [ "nixIpfs" ];
systemd.services.nix-ipfs-cache = {
wantedBy = [ "multi-user.target" ];
serviceConfig = {
2022-02-18 22:26:59 +02:00
ExecStart = "${py3}/bin/python3 -u ${./reflex.py} ${port}";
2022-01-30 21:28:16 +02:00
DynamicUser = true;
SupplementaryGroups = [ "ipfs" ];
CacheDirectory = "nix-ipfs-cache";
};
};
services.nginx.virtualHosts."reflex.${tools.meta.domain}" = tools.nginx.vhosts.proxy "http://127.0.0.1:${port}";
}