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

47 lines
1.0 KiB
Nix
Raw Normal View History

{ pkgs, ... }:
2023-10-08 12:13:38 -04:00
let
PROJECT_ROOT = "/workspace/deployed-nixos-server-and-apps/nixos-apps/fancytypist.dev";
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"
'';
};
"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
}