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