nixos

NixOS server files. Mirror from https://git.nordgedanken.dev/kubernetes/nixos
git clone git://archive.git.mtrnord.blog/MTRNord/nixos.git
Log | Files | Refs | README

commit 669cd72f98730ebc22be866753cd8bf34e5d698a
parent 6451ea4794263e67e58166ea38437e99af995096
Author: MTRNord <mtrnord1@gmail.com>
Date:   Tue, 26 Sep 2023 10:54:33 +0200

Move discourse to its own file

Diffstat:
Anixos/common/lib/discourse.nix | 79+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mnixos/worker-1/configuration.nix | 75+--------------------------------------------------------------------------
2 files changed, 80 insertions(+), 74 deletions(-)

diff --git a/nixos/common/lib/discourse.nix b/nixos/common/lib/discourse.nix @@ -0,0 +1,79 @@ +{ inputs, lib, pkgs, config, ... }: +{ + services.discourse = { + package = inputs.nixpkgs-discourse.legacyPackages.${pkgs.system}.discourse; + enable = true; + database = { + host = "postgres.internal.midnightthoughts.space"; + passwordFile = config.sops.secrets."discourse/db_password".path; + }; + backendSettings = { + db_port = 5000; + }; + secretKeyBaseFile = config.sops.secrets."discourse/secret_key_base".path; + mail = { + outgoing = { + port = 465; + serverAddress = "mail.nordgedanken.dev"; + username = "support@miki.community"; + passwordFile = config.sops.secrets."discourse/mail_password".path; + authentication = "login"; + forceTLS = true; + }; + incoming.enable = false; + contactEmailAddress = "support@miki.community"; + }; + redis = { + host = "localhost"; + }; + hostname = "forum.miki.community"; + plugins = with config.services.discourse.package.plugins; [ + discourse-github + discourse-solved + discourse-docs + discourse-calendar + discourse-github + discourse-assign + discourse-solved + discourse-chat-integration + discourse-data-explorer + pkgs.discourse-footnote + pkgs.discourse-gamification + pkgs.discourse-cakeday + pkgs.discourse-templates + #pkgs.discourse-spoiler-alert + ]; + siteSettings = { + required = { + title = "Matrix Projects Forum"; + contact_email = "support@miki.community"; + notification_email = "noreply@forum.miki.community"; + }; + login = { + login_required = false; + must_approve_users = false; + enable_local_logins = true; + enable_local_logins_via_email = true; + allow_new_registrations = true; + }; + spam = { + notify_mods_when_user_silenced = true; + }; + legal = { + tos_url = "https://docs.draupnir.midnightthoughts.space/docs/code_of_conduct/"; + }; + plugins = { + calendar_enabled = true; + chat_enabled = false; + }; + }; + admin = { + username = "MTRNord"; + fullName = "Marcel"; + email = "mtrnord@nordgedanken.dev"; + passwordFile = config.sops.secrets."discourse/admin_password".path; + }; + }; + + systemd.services.discourse.environment = { UNICORN_WORKERS = "8"; }; +} diff --git a/nixos/worker-1/configuration.nix b/nixos/worker-1/configuration.nix @@ -34,6 +34,7 @@ ../common/lib/fail2ban.nix ../common/lib/podman.nix ../common/lib/asterisk.nix + ../common/lib/discourse.nix ./kubernetes.nix ./znc.nix @@ -392,80 +393,6 @@ }; }; - discourse = { - package = inputs.nixpkgs-discourse.legacyPackages.${pkgs.system}.discourse; - enable = true; - database = { - host = "postgres.internal.midnightthoughts.space"; - passwordFile = config.sops.secrets."discourse/db_password".path; - }; - backendSettings = { - db_port = 5000; - }; - secretKeyBaseFile = config.sops.secrets."discourse/secret_key_base".path; - mail = { - outgoing = { - port = 465; - serverAddress = "mail.nordgedanken.dev"; - username = "support@miki.community"; - passwordFile = config.sops.secrets."discourse/mail_password".path; - authentication = "login"; - forceTLS = true; - }; - incoming.enable = false; - contactEmailAddress = "support@miki.community"; - }; - redis = { - host = "localhost"; - }; - hostname = "forum.miki.community"; - plugins = with config.services.discourse.package.plugins; [ - discourse-github - discourse-solved - discourse-docs - discourse-calendar - discourse-github - discourse-assign - discourse-solved - discourse-chat-integration - discourse-data-explorer - pkgs.discourse-footnote - pkgs.discourse-gamification - pkgs.discourse-cakeday - pkgs.discourse-templates - #pkgs.discourse-spoiler-alert - ]; - siteSettings = { - required = { - title = "Matrix Projects Forum"; - contact_email = "support@miki.community"; - notification_email = "noreply@forum.miki.community"; - }; - login = { - login_required = false; - must_approve_users = false; - enable_local_logins = true; - enable_local_logins_via_email = true; - allow_new_registrations = true; - }; - spam = { - notify_mods_when_user_silenced = true; - }; - legal = { - tos_url = "https://docs.draupnir.midnightthoughts.space/docs/code_of_conduct/"; - }; - plugins = { - calendar_enabled = true; - chat_enabled = false; - }; - }; - admin = { - username = "MTRNord"; - fullName = "Marcel"; - email = "mtrnord@nordgedanken.dev"; - passwordFile = config.sops.secrets."discourse/admin_password".path; - }; - }; tailscale = { enable = true; useRoutingFeatures = "both";