forked from
lass.pds.lassul.us/superconfig
This repository has no description
1.3 kB
55 lines
1{
2 self,
3 lib,
4 config,
5 ...
6}:
7{
8 imports = [
9 self.inputs.clan-core.clanModules.postgresql
10 ];
11 options.clan.hedgedoc = {
12 domain = lib.mkOption {
13 type = lib.types.str;
14 description = "The domain of the hedgedoc instance.";
15 };
16 };
17 config = {
18 clan.postgresql.users.hedgedoc = { };
19 clan.postgresql.databases.hedgedoc.create.options.OWNER = "matrix-synapse";
20 systemd.services.hedgedoc.environment = {
21 CMD_COOKIE_POLICY = "none";
22 CMD_CSP_ALLOW_FRAMING = "true";
23 };
24
25 services.hedgedoc = {
26 enable = true;
27 settings = {
28 allowOrigin = [ config.clan.hedgedoc.domain ];
29 db = {
30 dialect = "postgres";
31 host = "/run/postgresql";
32 database = "hedgedoc";
33 username = "hedgedoc";
34 };
35 useCDN = false;
36 port = 3091;
37 domain = config.clan.hedgedoc.domain;
38 allowFreeURL = true;
39 defaultPermission = "freely";
40 useSSL = false;
41 debug = true;
42 };
43 };
44
45 services.nginx.virtualHosts.${config.clan.hedgedoc.domain} = {
46 enableACME = true;
47 forceSSL = true;
48 locations."/" = {
49 proxyPass = "http://localhost:${toString config.services.hedgedoc.settings.port}";
50 proxyWebsockets = true;
51 };
52 };
53
54 };
55}