services/reflex: use reflex-cache package
This commit is contained in:
parent
ccffd920bc
commit
8771355dd6
1 changed files with 6 additions and 7 deletions
|
@ -1,11 +1,6 @@
|
||||||
{ config, pkgs, tools, ... }:
|
{ config, inputs, pkgs, tools, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
py3 = pkgs.python3.withPackages (ps: with ps; [
|
|
||||||
requests
|
|
||||||
requests-unixsocket
|
|
||||||
]);
|
|
||||||
|
|
||||||
port = config.portsStr.nixIpfs;
|
port = config.portsStr.nixIpfs;
|
||||||
in {
|
in {
|
||||||
reservePortsFor = [ "nixIpfs" ];
|
reservePortsFor = [ "nixIpfs" ];
|
||||||
|
@ -13,11 +8,15 @@ in {
|
||||||
systemd.services.nix-ipfs-cache = {
|
systemd.services.nix-ipfs-cache = {
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
ExecStart = "${py3}/bin/python3 -u ${./reflex.py} ${port}";
|
ExecStart = "${inputs.self.packages.${pkgs.system}.reflex-cache}/bin/reflex";
|
||||||
DynamicUser = true;
|
DynamicUser = true;
|
||||||
SupplementaryGroups = [ "ipfs" ];
|
SupplementaryGroups = [ "ipfs" ];
|
||||||
CacheDirectory = "nix-ipfs-cache";
|
CacheDirectory = "nix-ipfs-cache";
|
||||||
};
|
};
|
||||||
|
environment = {
|
||||||
|
REFLEX_PORT = port;
|
||||||
|
IPFS_API = config.services.ipfs.apiAddress;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
services.nginx.virtualHosts."reflex.${tools.meta.domain}" = tools.nginx.vhosts.proxy "http://127.0.0.1:${port}";
|
services.nginx.virtualHosts."reflex.${tools.meta.domain}" = tools.nginx.vhosts.proxy "http://127.0.0.1:${port}";
|
||||||
|
|
Loading…
Reference in a new issue