diff --git a/hosts/server/modules/www/anotherhadi.com.nix b/hosts/server/modules/www/anotherhadi.com.nix new file mode 100644 index 0000000..45332e6 --- /dev/null +++ b/hosts/server/modules/www/anotherhadi.com.nix @@ -0,0 +1,35 @@ +{ pkgs, lib, ... }: +let + package = pkgs.buildNpmPackage { + pname = "homepage"; + version = "0.0.0"; + + src = pkgs.fetchFromGitHub { + owner = "anotherhadi"; + repo = "portfolio"; + rev = "3f03233f7dcc5fb175c8bba8874a2f5c26999c93"; + hash = "sha256-q8cRi3DEwM/9DUxKbeJMv/TULf/mR0pg16orkd3xMNo="; + }; + + npmDepsHash = lib.fakeHash; + + buildPhase = '' + npm install + npm run build + mkdir $out + mv build $out + ''; + + meta = { + description = "portfolio"; + homepage = "https://github.com/anotherhadi/portfolio"; + }; + }; + +in { + services.nginx.virtualHosts."anotherhadi.com" = { + serverAliases = [ "www.anotherhadi.com" ]; + enableACME = true; + root = package + "/build"; + }; +} diff --git a/hosts/server/modules/www/anotherhadi.com/index.html b/hosts/server/modules/www/anotherhadi.com/index.html deleted file mode 100644 index 367ab48..0000000 --- a/hosts/server/modules/www/anotherhadi.com/index.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - Anotherhadi website - - - diff --git a/hosts/server/modules/www/default.nix b/hosts/server/modules/www/default.nix index 3e4db9c..e680f18 100644 --- a/hosts/server/modules/www/default.nix +++ b/hosts/server/modules/www/default.nix @@ -1,5 +1,9 @@ { - imports = [ ./home.anotherhadi.com.nix ./start.anotherhadi.com.nix ]; + imports = [ + ./home.anotherhadi.com.nix + ./start.anotherhadi.com.nix + ./anotherhadi.com.nix + ]; services.nginx.virtualHosts = { "anotherhadi.com" = {