dotfiles.nix/nixos/viridian/services/wiki-js/default.nix

43 lines
873 B
Nix
Raw Permalink Normal View History

2024-10-16 04:59:02 +08:00
{config, ...}: {
systemd.services.wiki-js = {
requires = ["postgresql.service"];
after = ["postgresql.service"];
};
services.wiki-js = {
enable = true;
settings.db = {
db = "wiki-js";
host = "/run/postgresql";
type = "postgres";
user = "wiki-js";
};
};
services.postgresql = {
ensureDatabases = ["wiki-js"];
ensureUsers = [
{
name = "wiki-js";
ensureDBOwnership = true;
}
];
};
services.traefik.dynamicConfigOptions.http.routers = {
wiki-js = {
2024-10-16 07:12:04 +08:00
rule = "Host(`docs.sajkbd.io`)";
2024-10-16 04:59:02 +08:00
entryPoints = [
"websecure"
];
service = "wiki-js";
};
};
services.traefik.dynamicConfigOptions.http.services = {
wiki-js.loadBalancer.servers = [
{url = "http://127.0.0.1:${toString config.services.wiki-js.settings.port}";}
];
};
}