about summary refs log tree commit diff
path: root/irc.nix
diff options
context:
space:
mode:
authorNguyễn Gia Phong <mcsinyx@disroot.org>2023-02-21 15:03:17 +0900
committerNguyễn Gia Phong <mcsinyx@disroot.org>2023-02-21 15:03:17 +0900
commit95859c41afd89ab97eca87819b4adaff672e8508 (patch)
tree498012a7d50cbaa8ce05463bf4c935eaec117b6a /irc.nix
parentac30f18118da23914a6f88134f39f2199d6213bb (diff)
downloadnixos-conf-95859c41afd89ab97eca87819b4adaff672e8508.tar.gz
Use PostgreSQL for 소주
Diffstat (limited to 'irc.nix')
-rw-r--r--irc.nix13
1 files changed, 12 insertions, 1 deletions
diff --git a/irc.nix b/irc.nix
index e8592c9..e8bdb09 100644
--- a/irc.nix
+++ b/irc.nix
@@ -20,7 +20,6 @@
 let
   inherit (config.networking) domain;
   cert = config.security.acme.certs.${domain};
-  port = 6697;
 in {
   environment.systemPackages = [ (pkgs.writeTextFile rec {
     name = "sojupw";
@@ -35,9 +34,21 @@ in {
   }) ];
 
   networking.firewall.allowedTCPPorts = [ 6697 ];
+
   services = {
+    postgresql = {
+      ensureDatabases = [ "soju" ];
+      ensureUsers = [ {
+        name = "soju";
+        ensurePermissions."DATABASE soju" = "ALL PRIVILEGES";
+      } ];
+    };
+
     soju = {
       enable = true;
+      extraConfig = ''
+        db postgres "host=/run/postgresql dbname=soju"
+      '';
       hostName = domain;
       tlsCertificate = "${cert.directory}/cert.pem";
       tlsCertificateKey = "${cert.directory}/key.pem";