1
1
Fork 0
deployed-nixos-server-and-apps/nixos-apps/fancytypist.com.nix

59 lines
1.3 KiB
Nix
Raw Normal View History

{ pkgs, ... }:
2023-10-08 12:13:38 -04:00
let
2023-10-08 12:41:03 -04:00
PROJECT_ROOT = "/workspace/deployed-nixos-server-and-apps/nixos-apps/fancyTypist.dev";
2023-10-08 12:13:38 -04:00
PORT = "12513";
HOST = "localhost";
in
2023-04-07 11:09:21 -04:00
{
services.caddy = {
enable = true;
virtualHosts = {
"fancytypist.com" = {
serverAliases = [ "www.fancytypist.com" ];
extraConfig = ''
respond "Hello, world! fancytypist.com"
'';
};
"fancytypist.ca" = {
serverAliases = [ "www.fancytypist.ca" ];
extraConfig = ''
respond "Hello, world! fancytypist.ca"
'';
};
2023-10-23 18:17:38 -04:00
"osds.fancytypist.ca" = {
extraConfig = ''
respond "Welcome to the Ottawa Swing Dance Society"
'';
};
"*.fancytypist.ca" = {
extraConfig = ''
respond "Welcome to subdomain...fancytypist.ca"
'';
};
2023-04-07 11:09:21 -04:00
"fancytypist.dev" = {
serverAliases = [ "www.fancytypist.dev" ];
extraConfig = ''
2023-10-08 12:13:38 -04:00
reverse_proxy ${HOST}:${PORT}
2023-04-07 11:09:21 -04:00
'';
};
};
};
2023-10-08 12:13:38 -04:00
systemd.services = {
fancyTypistDotDev-site = {
2023-10-08 12:13:38 -04:00
enable = true;
description = "The Haskell Servant executable server that hosts my FancyTypist.dev site.";
path = with pkgs; [ nix git ];
script = ''
cd ${PROJECT_ROOT}
nix run .#fancyTypistDotDev-site
2023-10-08 12:13:38 -04:00
'';
};
};
2023-04-07 11:09:21 -04:00
}