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

27 lines
774 B
Nix
Raw Normal View History

{ config, inputs, pkgs, tools, ... }:
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 = {
ExecStart = "${inputs.self.packages.${pkgs.system}.reflex-cache}/bin/reflex";
2022-01-30 21:28:16 +02:00
DynamicUser = true;
SupplementaryGroups = [ "ipfs" ];
CacheDirectory = "nix-ipfs-cache";
};
environment = {
2022-06-18 03:44:51 +03:00
REFLEX_PORT = config.links.nixIpfs.portStr;
IPFS_API = config.services.ipfs.apiAddress;
2022-03-13 03:16:01 +02:00
NIX_CACHES = toString [
"https://cache.nixos.org"
"https://cache.${tools.meta.domain}"
"https://max.cachix.org"
];
};
2022-01-30 21:28:16 +02:00
};
2022-06-18 03:44:51 +03:00
services.nginx.virtualHosts."reflex.${tools.meta.domain}" = tools.nginx.vhosts.proxy config.links.nixIpfs.url;
2022-01-30 21:28:16 +02:00
}