Tom Hubrecht
6b827e56b1
All checks were successful
lint / check (push) Successful in 25s
build configuration / build_web02 (push) Successful in 1m4s
build configuration / build_vault01 (push) Successful in 1m6s
build configuration / build_storage01 (push) Successful in 1m13s
build configuration / build_compute01 (push) Successful in 1m25s
build configuration / build_web01 (push) Successful in 1m27s
62 lines
1.1 KiB
Nix
62 lines
1.1 KiB
Nix
{ config, lib, ... }:
|
|
|
|
let
|
|
host = "pads.dgnum.eu";
|
|
port = 3007;
|
|
in
|
|
{
|
|
services = {
|
|
hedgedoc = {
|
|
enable = true;
|
|
|
|
environmentFile = config.age.secrets."hedgedoc-environment_file".path;
|
|
|
|
settings = {
|
|
inherit port;
|
|
|
|
domain = host;
|
|
host = "127.0.0.1";
|
|
allowOrigin = [ host ];
|
|
|
|
protocolUseSSL = true;
|
|
|
|
allowFreeURL = true;
|
|
|
|
db = {
|
|
dialect = "postgres";
|
|
host = "/run/postgresql";
|
|
};
|
|
};
|
|
};
|
|
|
|
nginx.virtualHosts.${host} = {
|
|
forceSSL = true;
|
|
enableACME = true;
|
|
|
|
locations."/" = {
|
|
proxyPass = "http://127.0.0.1:${builtins.toString port}";
|
|
proxyWebsockets = true;
|
|
};
|
|
};
|
|
|
|
postgresql = {
|
|
enable = true;
|
|
|
|
ensureDatabases = [ "hedgedoc" ];
|
|
|
|
ensureUsers = [
|
|
{
|
|
name = "hedgedoc";
|
|
ensureDBOwnership = true;
|
|
}
|
|
];
|
|
};
|
|
};
|
|
|
|
systemd.services.hedgedoc.serviceConfig.StateDirectory = lib.mkForce [
|
|
"hedgedoc"
|
|
"hedgedoc/uploads"
|
|
];
|
|
|
|
dgn-backups.jobs.hedgedoc.settings.paths = [ "/var/lib/hedgedoc" ];
|
|
}
|