infrastructure/machines/nixos/compute01/hedgedoc.nix
Tom Hubrecht ecbad0a638
chore: Abstract machines and modules
This adds subdirectories for the different types of systems, for the
modules and the machines
2024-12-08 13:39:10 +01:00

58 lines
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";
};
};
};
postgresql = {
enable = true;
ensureDatabases = [ "hedgedoc" ];
ensureUsers = [
{
name = "hedgedoc";
ensureDBOwnership = true;
}
];
};
};
dgn-web.simpleProxies.hedgedoc = {
inherit host port;
proxyWebsockets = true;
};
systemd.services.hedgedoc.serviceConfig.StateDirectory = lib.mkForce [
"hedgedoc"
"hedgedoc/uploads"
];
dgn-backups.jobs.hedgedoc.settings.paths = [ "/var/lib/hedgedoc" ];
dgn-backups.postgresDatabases = [ "hedgedoc" ];
}