nixos-config/config/services/chir-rs.nix

31 lines
787 B
Nix
Raw Normal View History

2022-06-12 15:39:15 +00:00
{pkgs, ...}: {
2022-01-17 19:53:47 +00:00
systemd.services.chirrs = {
enable = true;
2022-01-17 20:07:20 +00:00
description = "chir.rs";
2022-01-17 19:54:58 +00:00
script = "${pkgs.chir-rs}/chir-rs-server";
2022-01-17 19:53:47 +00:00
serviceConfig = {
2022-01-17 19:54:58 +00:00
WorkingDirectory = pkgs.chir-rs;
2022-01-17 19:53:47 +00:00
EnvironmentFile = "/run/secrets/services/chir.rs";
};
2022-06-12 15:39:15 +00:00
wantedBy = ["multi-user.target"];
2022-01-17 19:53:47 +00:00
};
2022-08-26 15:28:14 +00:00
services.caddy.virtualHosts."api.chir.rs" = {
useACMEHost = "chir.rs";
extraConfig = ''
import baseConfig
2022-08-26 16:00:06 +00:00
rewrite * /api.chir.rs/{path}
2022-08-26 15:28:14 +00:00
reverse_proxy {
to http://localhost:8621
}
'';
2022-01-17 20:07:20 +00:00
};
2022-06-12 15:39:15 +00:00
services.postgresql.ensureDatabases = ["homepage"];
services.postgresql.ensureUsers = [
{
name = "homepage";
ensurePermissions = {"DATABASE homepage" = "ALL PRIVILEGES";};
}
];
sops.secrets."services/chir.rs" = {};
2022-01-17 19:53:47 +00:00
}