1 { lib, pkgs, config, ... }:
3 cfg = config.myServices.websites.tools.commento;
4 env = config.myEnv.tools.commento;
5 webPort = "${host}:${port}";
6 port = toString env.listenPort;
8 postgresql_url = "postgres://${env.postgresql.user}:${env.postgresql.password}@localhost:${env.postgresql.port}/${env.postgresql.database}?sslmode=disable";
11 options.myServices.websites.tools.commento = {
12 enable = lib.mkEnableOption "Enable commento website";
14 config = lib.mkIf cfg.enable {
15 myServices.chatonsProperties.services.commento = {
16 file.datetime = "2022-08-21T01:11:00";
19 description = "Commento is a fast, privacy-focused commenting platform";
20 website = "https://commento.immae.eu";
21 logo = "https://commento.immae.eu/images/logo.svg";
23 status.description = "OK";
24 registration."" = ["MEMBER" "CLIENT"];
25 registration.load = "OPEN";
26 install.type = "PACKAGE";
30 website = "https://www.commento.io/";
31 license.url = "https://gitlab.com/commento/commento/-/blob/master/LICENSE";
32 license.name = "MIT License";
33 version = pkgs.commento.version;
34 source.url = "https://gitlab.com/commento/commento";
41 COMMENTO_ORIGIN=https://commento.immae.eu/
43 COMMENTO_POSTGRES=${postgresql_url}
44 COMMENTO_FORBID_NEW_OWNERS=true
45 COMMENTO_BIND_ADDRESS=${host}
46 COMMENTO_GZIP_STATIC=true
47 COMMENTO_SMTP_HOST=${env.smtp.host}
48 COMMENTO_SMTP_PORT=${env.smtp.port}
49 COMMENTO_SMTP_USERNAME=${env.smtp.email}
50 COMMENTO_SMTP_PASSWORD=${env.smtp.password}
51 COMMENTO_SMTP_FROM_ADDRESS=${env.smtp.email}
56 services.websites.env.tools.vhostConfs.commento = {
59 hosts = [ "commento.immae.eu" ];
63 ProxyPass / http://${webPort}/
64 ProxyPassReverse / http://${webPort}/
69 systemd.services.commento = {
70 description = "Commento";
71 wantedBy = [ "multi-user.target" ];
72 requires = ["postgresql.service"];
73 after = ["network.target" "postgresql.service"];
76 ExecStart = "${pkgs.commento}/commento";
77 EnvironmentFile = config.secrets.fullPaths."commento/env";