summary refs log tree commit diff
path: root/host/Rory-nginx
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2024-06-10 17:33:26 +0200
committerRory& <root@rory.gay>2024-07-04 14:45:02 +0200
commite37b430512bbef89dfe8ab75454286de4836ab6e (patch)
treeaf3468855573725fefc29ab8935edcc663d6b6a3 /host/Rory-nginx
parentBunch of changes (diff)
downloadRory-Open-Architecture-e37b430512bbef89dfe8ab75454286de4836ab6e.tar.xz
Add portable config, some updates
Diffstat (limited to 'host/Rory-nginx')
-rwxr-xr-xhost/Rory-nginx/services/nginx/nginx.nix14
1 files changed, 12 insertions, 2 deletions
diff --git a/host/Rory-nginx/services/nginx/nginx.nix b/host/Rory-nginx/services/nginx/nginx.nix
index 91340c7..2e2d671 100755
--- a/host/Rory-nginx/services/nginx/nginx.nix
+++ b/host/Rory-nginx/services/nginx/nginx.nix
@@ -1,6 +1,16 @@
 { config, pkgs, lib, ... }:
-
-{
+let 
+  serveDir = config : {
+    enableACME = if config ? ssl then config.ssl else true;
+    addSSL = if config ? ssl then config.ssl else true;
+    root = if config ? path then config.path else builtins.throw "path is required";
+    locations = {
+      "/" = {
+        index = "index.html";
+      };
+    };
+  };
+in {
   services = {
     nginx = {
       enable = true;