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

69 lines
1.6 KiB
Nix

{ pkgs, ... }:
let
PROJECT_ROOT = "/workspace/deployed-nixos-server-and-apps/nixos-apps/fancyTypist.dev";
HOST = "localhost";
PORT = 12513;
in
{
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"
'';
};
"osds.fancytypist.ca" = {
extraConfig = ''
respond "Welcome to the Ottawa Swing Dance Society"
'';
};
"helpme.fancytypist.ca" = {
extraConfig = ''
respond "Welcome to only other subdomain...helpme!"
'';
};
"fancytypist.dev" = {
serverAliases = [ "www.fancytypist.dev" ];
extraConfig = ''
reverse_proxy ${HOST}:${toString PORT}
'';
};
};
};
systemd.services = {
fancyTypistDotDev-site = {
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
'';
};
osdsFancyTypistSubdomain-site = {
enable = true;
description = "Emanote site running the OSDS content.";
path = with pkgs; [ nix git ];
script = ''
cd ${PROJECT_ROOT}
nix run .#osdsFancyTypistSubdomain-site
'';
};
};
}