summary refs log tree commit diff stats
path: root/system/services/libreddit
diff options
context:
space:
mode:
authorSoispha <soispha@vhack.eu>2023-08-18 14:19:12 +0200
committerSoispha <soispha@vhack.eu>2023-08-18 14:19:12 +0200
commit097d566da1b3fe4092d8daa38034cf9b4c64556f (patch)
tree7e9cd71b98b5d1c55e20b58806c90d1cde82e7bd /system/services/libreddit
parentFeat(system/services/libreddit): Init (diff)
downloadnixos-server-097d566da1b3fe4092d8daa38034cf9b4c64556f.tar.gz
nixos-server-097d566da1b3fe4092d8daa38034cf9b4c64556f.zip
Fix(system/services/libreddit): Actually proxy services via nginx
Diffstat (limited to '')
-rw-r--r--system/services/libreddit/default.nix20
1 files changed, 18 insertions, 2 deletions
diff --git a/system/services/libreddit/default.nix b/system/services/libreddit/default.nix
index e52507f..581445c 100644
--- a/system/services/libreddit/default.nix
+++ b/system/services/libreddit/default.nix
@@ -1,7 +1,23 @@
-{...}: {
+{
+  config,
+  lib,
+  ...
+}: let
+  domain = "libreddit.vhack.eu";
+in {
   services.libreddit = {
     enable = true;
-    address = "libreddit.vhack.eu";
+    address = "127.0.0.1";
     openFirewall = true;
   };
+
+  services.nginx = {
+    enable = true;
+    virtualHosts.${domain} = {
+      locations."/".proxyPass = "http://127.0.0.1:${toString config.services.libreddit.port}";
+
+      enableACME = lib.mkDefault true;
+      forceSSL = lib.mkDefault true;
+    };
+  };
 }