2023-08-31 01:55:45 +03:00
|
|
|
{ config, depot, ... }:
|
2022-01-30 21:28:16 +02:00
|
|
|
|
2022-06-18 03:44:51 +03:00
|
|
|
{
|
|
|
|
links.nixIpfs.protocol = "http";
|
2022-01-30 21:28:16 +02:00
|
|
|
|
|
|
|
systemd.services.nix-ipfs-cache = {
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
serviceConfig = {
|
2023-02-24 16:16:15 +02:00
|
|
|
ExecStart = "${depot.packages.reflex-cache}/bin/reflex";
|
2022-01-30 21:28:16 +02:00
|
|
|
DynamicUser = true;
|
|
|
|
SupplementaryGroups = [ "ipfs" ];
|
|
|
|
CacheDirectory = "nix-ipfs-cache";
|
|
|
|
};
|
2022-02-26 01:48:30 +02:00
|
|
|
environment = {
|
2022-06-18 03:44:51 +03:00
|
|
|
REFLEX_PORT = config.links.nixIpfs.portStr;
|
2022-02-26 01:48:30 +02:00
|
|
|
IPFS_API = config.services.ipfs.apiAddress;
|
2022-12-19 01:10:20 +02:00
|
|
|
IPFS_CLUSTER_API = config.services.ipfs-cluster.settings.api.restapi.http_listen_multiaddress;
|
2022-03-13 03:16:01 +02:00
|
|
|
NIX_CACHES = toString [
|
|
|
|
"https://cache.nixos.org"
|
2023-08-31 01:55:45 +03:00
|
|
|
"https://cache.${depot.lib.meta.domain}"
|
2022-03-13 03:16:01 +02:00
|
|
|
"https://max.cachix.org"
|
|
|
|
];
|
2022-02-26 01:48:30 +02:00
|
|
|
};
|
2022-01-30 21:28:16 +02:00
|
|
|
};
|
|
|
|
|
2023-08-31 01:55:45 +03:00
|
|
|
services.nginx.virtualHosts."reflex.${depot.lib.meta.domain}" = depot.lib.nginx.vhosts.proxy config.links.nixIpfs.url;
|
2022-01-30 21:28:16 +02:00
|
|
|
}
|