From 0114f7281b5b2f01c21e8056b3ab71b487e43e49 Mon Sep 17 00:00:00 2001
From: Hadi <112569860+anotherhadi@users.noreply.github.com>
Date: Thu, 20 Jun 2024 00:14:15 +0200
Subject: [PATCH] Update
---
hosts/modules/server/nginx.nix | 20 -------------------
.../server/www/anotherhadi.com/index.html | 12 +++++++++++
hosts/modules/server/www/default.nix | 15 ++++++++++++++
.../home.anotherhadi.com}/default.nix | 2 +-
hosts/server/configuration.nix | 2 +-
5 files changed, 29 insertions(+), 22 deletions(-)
create mode 100644 hosts/modules/server/www/anotherhadi.com/index.html
create mode 100644 hosts/modules/server/www/default.nix
rename hosts/modules/server/{homepage => www/home.anotherhadi.com}/default.nix (99%)
diff --git a/hosts/modules/server/nginx.nix b/hosts/modules/server/nginx.nix
index 9685700..524884d 100644
--- a/hosts/modules/server/nginx.nix
+++ b/hosts/modules/server/nginx.nix
@@ -7,24 +7,4 @@
};
networking.firewall.allowedTCPPorts = [ 80 443 ];
- # test
- services.nginx.virtualHosts."anotherhadi.com" = {
- serverAliases = [ "www.anotherhadi.com" ];
- root = "/etc/www/home";
- };
-
- environment.etc = {
- "www/home/index.html" = {
- text = ''
-
-
- Another Hadi
-
-
- Another Hadi
-
-
- '';
- };
- };
}
diff --git a/hosts/modules/server/www/anotherhadi.com/index.html b/hosts/modules/server/www/anotherhadi.com/index.html
new file mode 100644
index 0000000..367ab48
--- /dev/null
+++ b/hosts/modules/server/www/anotherhadi.com/index.html
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+ Anotherhadi website
+
+
+
diff --git a/hosts/modules/server/www/default.nix b/hosts/modules/server/www/default.nix
new file mode 100644
index 0000000..f3c9acc
--- /dev/null
+++ b/hosts/modules/server/www/default.nix
@@ -0,0 +1,15 @@
+{
+
+ imports = [ ./home.anotherhadi.com ];
+
+ services.nginx.virtualHosts = {
+ "anotherhadi.com" = {
+ serverAliases = [ "www.anotherhadi.com" ];
+ root = "/etc/www/anotherhadi.com";
+ };
+ "home.anotherhadi.com" = { root = "/etc/www/home.anotherhadi.com"; };
+ };
+ environment.etc."www" = {
+ "anotherhadi.com" = { source = ./home.anotherhadi.com; };
+ };
+}
diff --git a/hosts/modules/server/homepage/default.nix b/hosts/modules/server/www/home.anotherhadi.com/default.nix
similarity index 99%
rename from hosts/modules/server/homepage/default.nix
rename to hosts/modules/server/www/home.anotherhadi.com/default.nix
index 7297ad1..51590f5 100644
--- a/hosts/modules/server/homepage/default.nix
+++ b/hosts/modules/server/www/home.anotherhadi.com/default.nix
@@ -11,7 +11,7 @@ let
'';
in {
- # fix "startpage/index.html".text = ''
+ environment.etc."www/home.anotherhadi.com".text = ''
diff --git a/hosts/server/configuration.nix b/hosts/server/configuration.nix
index ce271a9..faa3dd0 100644
--- a/hosts/server/configuration.nix
+++ b/hosts/server/configuration.nix
@@ -10,7 +10,7 @@
../modules/server/nextcloud.nix
../modules/server/vaultwarden.nix
- # ../modules/server/homepage/default.nix
+ ../modules/server/www
../modules/server/adguard.nix
../modules/server/ntfy-sh.nix
../modules/server/tailscale.nix