2023-08-02 14:37:36 -04:00
|
|
|
{ pkgs, ... }:
|
|
|
|
|
2023-05-08 18:39:01 -04:00
|
|
|
let
|
|
|
|
PROJECT_ROOT = builtins.toString ./.;
|
|
|
|
in
|
2023-04-08 21:40:56 -04:00
|
|
|
{
|
|
|
|
services.caddy = {
|
|
|
|
enable = true;
|
|
|
|
virtualHosts = {
|
|
|
|
"cutesealfanpage.love" = {
|
|
|
|
serverAliases = [ "www.cutesealfanpage.love" ];
|
|
|
|
extraConfig = ''
|
2023-08-09 21:13:29 -04:00
|
|
|
root * ${PROJECT_ROOT}/cutesealfanpage.love/_site
|
2023-05-08 18:39:01 -04:00
|
|
|
file_server
|
2023-04-08 21:40:56 -04:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2023-05-08 18:39:01 -04:00
|
|
|
|
2023-08-09 19:07:15 -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-08-09 20:49:47 -04:00
|
|
|
serviceConfig = {
|
2023-08-09 21:13:29 -04:00
|
|
|
ExecStart = "cd ${PROJECT_ROOT}/cutesealfanpage.love; nix run .#hakyll-site -- watch --no-server";
|
2023-08-09 20:49:47 -04:00
|
|
|
};
|
|
|
|
# script = ''
|
|
|
|
# cd ${PROJECT_ROOT}/cutesealfanpage.love
|
|
|
|
# ${pkgs.nix}/bin/nix run .#hakyll-site -- watch --no-server
|
|
|
|
# '';
|
2023-08-09 19:07:15 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
cutesealfanpage-generatePosts = {
|
|
|
|
enable = true;
|
|
|
|
description = "The haskell script that creates the new post of the day.";
|
|
|
|
startAt = "08:12:42";
|
|
|
|
script = ''
|
2023-08-09 21:13:29 -04:00
|
|
|
cd ${PROJECT_ROOT}/cutesealfanpage.love
|
2023-08-09 19:15:26 -04:00
|
|
|
${pkgs.nix}/bin/nix run .#generateSealPosts
|
2023-08-09 19:07:15 -04:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-08-02 11:55:31 -04:00
|
|
|
# when in doubt, clear away the certs with
|
|
|
|
# sudo rm -rf /var/lib/acme/
|
|
|
|
security.acme.acceptTerms = true;
|
2023-08-02 14:37:36 -04:00
|
|
|
security.acme.defaults.email = "admin@cutesealfanpage.love";
|
2023-08-02 11:55:31 -04:00
|
|
|
# uncomment this to use the staging server
|
|
|
|
# security.acme.server = "https://acme-staging-v02.api.letsencrypt.org/directory";
|
|
|
|
|
2023-08-08 18:11:54 -04:00
|
|
|
# services.cron = {
|
|
|
|
# enable = true;
|
|
|
|
# systemCronJobs = [
|
|
|
|
# "12 12 * * * alice . /etc/profile; ${pkgs.newSealPost} > /home/alice/logs/backup.log 2>&1"
|
|
|
|
# ];
|
|
|
|
# };
|
2023-04-08 21:40:56 -04:00
|
|
|
}
|