1
1
Fork 0
deployed-nixos-server-and-apps/nixos-apps/cutesealfanpage.love.nix

49 lines
1.0 KiB
Nix
Raw Normal View History

2023-08-02 14:37:36 -04:00
{ pkgs, ... }:
2023-05-08 18:39:01 -04:00
let
2023-09-21 15:27:14 -04:00
PROJECT_ROOT = "/workspace/deployed-nixos-server-and-apps/nixos-apps/cutesealfanpage.love";
2023-05-08 18:39:01 -04:00
in
{
services.caddy = {
enable = true;
virtualHosts = {
"cutesealfanpage.love" = {
serverAliases = [ "www.cutesealfanpage.love" ];
extraConfig = ''
2023-09-21 15:27:14 -04:00
root * ${PROJECT_ROOT}/_site
2023-05-08 18:39:01 -04:00
file_server
'';
};
};
};
2023-05-08 18:39:01 -04:00
systemd.services = {
cutesealfanpage-hakyll-site = {
enable = true;
description = "The hakyll executable that rebuilds the site when a new blog post is created.";
2023-09-20 01:20:44 -04:00
path = with pkgs; [
nix
git
];
2023-09-20 00:32:00 -04:00
script = ''
2023-09-21 15:27:14 -04:00
cd ${PROJECT_ROOT}
2023-09-20 01:20:44 -04:00
nix run .#hakyll-site -- watch --no-server
2023-09-20 00:32:00 -04:00
'';
};
cutesealfanpage-generatePosts = {
enable = true;
description = "The haskell script that creates the new post of the day.";
startAt = "08:12:42";
2023-09-20 01:20:44 -04:00
path = with pkgs; [
nix
git
];
2023-09-20 00:32:00 -04:00
script = ''
2023-09-21 15:27:14 -04:00
cd ${PROJECT_ROOT}
2023-09-20 00:32:00 -04:00
nix run .#generateSealPosts
'';
};
};
}