Compare commits

..

3 Commits

7 changed files with 97 additions and 49 deletions

View File

@ -4,11 +4,18 @@ let
"github:jrpotter/blog/457bfd6c521d5d8eeb41deb7d5d6a925fd55dda9"; "github:jrpotter/blog/457bfd6c521d5d8eeb41deb7d5d6a925fd55dda9";
in in
{ {
services.nginx.virtualHosts."blog.jrpotter.com" = { services.nginx = {
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
virtualHosts."blog.jrpotter.com" = {
forceSSL = true; forceSSL = true;
enableACME = true; enableACME = true;
locations."/" = { locations."/" = {
root = blog.packages.${system}.app; root = blog.packages.${system}.app;
}; };
}; };
};
} }

View File

@ -9,15 +9,21 @@ let
in in
{ {
services = { services = {
nginx.virtualHosts."www.boardwise.gg" = { nginx = {
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
virtualHosts."www.boardwise.gg" = {
forceSSL = true; forceSSL = true;
enableACME = true; enableACME = true;
serverAliases = [ "boardwise.gg" ]; serverAliases = [ "boardwise.gg" ];
locations."/" = { locations."/" = {
recommendedProxySettings = true;
proxyPass = "http://127.0.0.1:4000"; proxyPass = "http://127.0.0.1:4000";
}; };
}; };
};
postgresql = { postgresql = {
package = pkgs.postgresql_15; package = pkgs.postgresql_15;
ensureDatabases = [ "boardwise" ]; ensureDatabases = [ "boardwise" ];
@ -42,9 +48,9 @@ in
Type = "exec"; Type = "exec";
EnvironmentFile = "/run/secrets/BOARDWISE_SECRET_KEY_BASE"; EnvironmentFile = "/run/secrets/BOARDWISE_SECRET_KEY_BASE";
ExecStartPre = "${boardwise}/bin/migrate"; ExecStartPre = "${boardwise}/bin/migrate";
ExecStart = "${boardwise}/bin/boardwise start"; ExecStart = "${boardwise}/bin/server start";
ExecStop = "${boardwise}/bin/reconn stop"; ExecStop = "${boardwise}/bin/server stop";
ExecReload = "${boardwise}/bin/reconn restart"; ExecReload = "${boardwise}/bin/server restart";
Restart = "on-failure"; Restart = "on-failure";
}; };
}; };

View File

@ -4,11 +4,18 @@ let
"github:jrpotter/bookshelf/bf9888c050b7a62f58be0198af19a6de7c40b375"; "github:jrpotter/bookshelf/bf9888c050b7a62f58be0198af19a6de7c40b375";
in in
{ {
services.nginx.virtualHosts."bookshelf.jrpotter.com" = { services.nginx = {
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
virtualHosts."bookshelf.jrpotter.com" = {
forceSSL = true; forceSSL = true;
enableACME = true; enableACME = true;
locations."/" = { locations."/" = {
root = bookshelf.packages.${system}.app; root = bookshelf.packages.${system}.app;
}; };
}; };
};
} }

View File

@ -41,13 +41,19 @@
}; };
}; };
}; };
nginx.virtualHosts."git.jrpotter.com" = { nginx = {
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
virtualHosts."git.jrpotter.com" = {
forceSSL = true; forceSSL = true;
enableACME = true; enableACME = true;
locations."/" = { locations."/" = {
recommendedProxySettings = true;
proxyPass = "http://127.0.0.1:3000"; proxyPass = "http://127.0.0.1:3000";
}; };
}; };
}; };
};
} }

View File

@ -4,7 +4,13 @@ let
"github:jrpotter/notebook/79b715a64c703279f593cad08775b0d73400a19b"; "github:jrpotter/notebook/79b715a64c703279f593cad08775b0d73400a19b";
in in
{ {
services.nginx.virtualHosts."notebook.jrpotter.com" = { services.nginx = {
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
virtualHosts."notebook.jrpotter.com" = {
forceSSL = true; forceSSL = true;
enableACME = true; enableACME = true;
locations."/" = { locations."/" = {
@ -12,4 +18,5 @@ in
tryFiles = "$uri $uri.html $uri/ =404"; tryFiles = "$uri $uri.html $uri/ =404";
}; };
}; };
};
} }

View File

@ -4,7 +4,13 @@ let
"github:jrpotter/portfolio/eca5e764f26faaa64f6966dbf3970b86eaaf2195"; "github:jrpotter/portfolio/eca5e764f26faaa64f6966dbf3970b86eaaf2195";
in in
{ {
services.nginx.virtualHosts."www.jrpotter.com" = { services.nginx = {
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
virtualHosts."www.jrpotter.com" = {
forceSSL = true; forceSSL = true;
enableACME = true; enableACME = true;
serverAliases = [ "jrpotter.com" ]; serverAliases = [ "jrpotter.com" ];
@ -12,4 +18,5 @@ in
root = portfolio.packages.${system}.app; root = portfolio.packages.${system}.app;
}; };
}; };
};
} }

View File

@ -1,18 +1,25 @@
{ system, pkgs, lib, ... }: { system, pkgs, lib, ... }:
let let
reconn = ( reconn = (
builtins.getFlake "git+https://git.jrpotter.com/r/reconn?rev=74cb0be878441c4eafcfd2b2c2c926fe87ea8a30" builtins.getFlake "git+ssh://forgejo@git.jrpotter.com/r/reconn?rev=42376b2060d00856ed3ea3e9ef9177ef6c7bca80"
).packages.${system}.app; ).packages.${system}.app;
in in
{ {
services = { services = {
nginx.virtualHosts."www.hideandseek.live" = { nginx = {
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
virtualHosts."www.hideandseek.live" = {
forceSSL = true; forceSSL = true;
enableACME = true; enableACME = true;
serverAliases = [ "hideandseek.live" ]; serverAliases = [ "hideandseek.live" ];
locations."/" = { locations."/" = {
recommendedProxySettings = true;
proxyPass = "http://127.0.0.1:4000"; proxyPass = "http://127.0.0.1:4000";
proxyWebsockets = true;
};
}; };
}; };
postgresql = { postgresql = {
@ -33,15 +40,16 @@ in
after = [ "network.target" "postgresql.service" ]; after = [ "network.target" "postgresql.service" ];
requires = [ "network-online.target" "postgresql.service" ]; requires = [ "network-online.target" "postgresql.service" ];
environment = { environment = {
PHX_HOST = "hideandseek.live";
DATABASE_URL = "ecto://postgres:postgres@localhost/reconn"; DATABASE_URL = "ecto://postgres:postgres@localhost/reconn";
}; };
serviceConfig = { serviceConfig = {
Type = "exec"; Type = "exec";
EnvironmentFile = "/run/secrets/RECONN_SECRET_KEY_BASE"; EnvironmentFile = "/run/secrets/RECONN_SECRET_KEY_BASE";
ExecStartPre = "${reconn}/bin/migrate"; ExecStartPre = "${reconn}/bin/migrate";
ExecStart = "${reconn}/bin/reconn start"; ExecStart = "${reconn}/bin/server start";
ExecStop = "${reconn}/bin/reconn stop"; ExecStop = "${reconn}/bin/server stop";
ExecReload = "${reconn}/bin/reconn restart"; ExecReload = "${reconn}/bin/server restart";
Restart = "on-failure"; Restart = "on-failure";
}; };
}; };