56 lines
1.1 KiB
Nix
56 lines
1.1 KiB
Nix
{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 = {
|
|
rule = "Host(`docs.sajkbd.io`)";
|
|
entryPoints = [
|
|
"websecure"
|
|
];
|
|
middlewares = [
|
|
"crowdsec"
|
|
"geoblock"
|
|
];
|
|
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}";}
|
|
];
|
|
};
|
|
|
|
environment.persistence."/persist" = {
|
|
directories = [
|
|
{
|
|
directory = "/var/lib/private";
|
|
mode = "0700";
|
|
}
|
|
];
|
|
};
|
|
}
|