summary refs log tree commit diff stats
path: root/services
diff options
context:
space:
mode:
authorene <ene@sils.li>2023-03-20 15:03:19 +0100
committerene <ene@sils.li>2023-03-20 15:03:19 +0100
commit6e1e8125bb4186ecf32017a3a09ec980fdc2cb7d (patch)
tree7af41a629acce6bad36e43d61473b6113dc23b47 /services
parentFix(services): Remove Minecraft (diff)
downloadnixos-server-6e1e8125bb4186ecf32017a3a09ec980fdc2cb7d.tar.gz
nixos-server-6e1e8125bb4186ecf32017a3a09ec980fdc2cb7d.zip
Revert "Revert "Merge pull request 'Feat: Add Website' (#17) from server1_nginx into server1""
This reverts commit b0599a3d23878da7335e6ae754ebffbd9ac7cbc3.
This may seem ridiculous, and it is, but some things are just necessary.
Diffstat (limited to 'services')
-rw-r--r--services/default.nix2
-rw-r--r--services/services/acme.nix6
-rw-r--r--services/services/nginx.nix15
3 files changed, 23 insertions, 0 deletions
diff --git a/services/default.nix b/services/default.nix
index 8029ee2..c301ba1 100644
--- a/services/default.nix
+++ b/services/default.nix
@@ -1,5 +1,7 @@
 {config, ...}: {
   imports = [
+    ./services/acme.nix
+    ./services/nginx.nix
     ./services/nix.nix
     ./services/opensshd.nix
     ./services/rust-motd.nix
diff --git a/services/services/acme.nix b/services/services/acme.nix
new file mode 100644
index 0000000..42f9ed5
--- /dev/null
+++ b/services/services/acme.nix
@@ -0,0 +1,6 @@
+{...}: {
+  security.acme = {
+    acceptTerms = true;
+    defaults.email = "admin@vhack.eu";
+  };
+}
diff --git a/services/services/nginx.nix b/services/services/nginx.nix
new file mode 100644
index 0000000..204783b
--- /dev/null
+++ b/services/services/nginx.nix
@@ -0,0 +1,15 @@
+{...}: {
+  networking.firewall = {
+    allowedTCPPorts = [80 443];
+  };
+  services.nginx = {
+    enable = true;
+    virtualHosts = {
+      "vhack.eu" = {
+        forceSSL = true;
+        enableACME = true;
+        root = "/srv/www/vhack.eu";
+      };
+    };
+  };
+}