49 lines
1,016 B
Nix
49 lines
1,016 B
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(`wiki.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 = ["/var/lib/wiki-js"];
|
||
|
}
|