muliple(teal): Update teal
feat: Add a.starrysky.blog
feat: re-key keys with shorthairNanoResident age key
chore: update packages
fix: redo headscale options
Change-Id: I27cab9abc4622f0a69811e35d4e0eb87af29b42b
Reviewed-on: https://git.clicks.codes/c/Infra/NixFiles/+/981
Reviewed-by: Skyler Grey <minion@clicks.codes>
Tested-by: Skyler Grey <minion@clicks.codes>
diff --git a/modules/nixos/clicks/sites/a.starrysky.blog/default.nix b/modules/nixos/clicks/sites/a.starrysky.blog/default.nix
new file mode 100644
index 0000000..51058fc
--- /dev/null
+++ b/modules/nixos/clicks/sites/a.starrysky.blog/default.nix
@@ -0,0 +1,57 @@
+# SPDX-FileCopyrightText: 2024 Clicks Codes
+#
+# SPDX-License-Identifier: GPL-3.0-only
+
+{ config, inputs, lib, system, pkgs, ... }:
+let
+ siteUrl = "a.starrysky.blog";
+ blogTitle = "A Starry Blog";
+ publicTitleRegex = ''(M36\.31\+[0-9]+ )?(?<title>.*)'';
+ blogPath = "/persist/data/var/lib/silverbullet/Skyler Grey/M36 Personal/30-39 Creativity/31 Blog";
+in
+{
+ options.clicks.sites."${siteUrl}".enable = lib.options.mkEnableOption "Enable hosting https://${siteUrl}";
+
+ config = lib.modules.mkIf config.clicks.sites."${siteUrl}".enable {
+ clicks.services.nginx = {
+ enable = true;
+
+ hosts.${siteUrl} = {
+ service = lib.clicks.nginx.http.directory "/var/lib/whisk/${siteUrl}";
+ www = false;
+ enableHttp = true;
+ };
+ };
+
+ environment.systemPackages = [ pkgs.nodejs-slim_23 ];
+
+ systemd.services."${siteUrl}-setup" = {
+ script = ''
+ export PATH=${pkgs.nodejs-slim_23}/bin:${pkgs.pnpm}/bin::$PATH
+ WORKDIR=$(mktemp -d)
+ cp -r ${inputs.whisk}/frontend/* $WORKDIR
+ cd $WORKDIR
+ pnpm i --reporter=append-only
+
+ mkdir -p /var/lib/whisk
+ rm -rf /var/lib/whisk/${siteUrl}
+
+ export BLOG_PATH='${blogPath}'
+ export PUBLIC_TITLE_REGEX='${publicTitleRegex}'
+ export SITE_URL='${siteUrl}'
+ export BLOG_TITLE='${blogTitle}'
+
+ echo $BLOG_PATH
+
+ pnpm run build --outDir /var/lib/whisk/${siteUrl}
+ '';
+
+ serviceConfig.Type = "oneshot";
+
+ path = [ pkgs.nodejs-slim_23 pkgs.pnpm ];
+
+ wantedBy = [ "nginx.service" ];
+ before = [ "nginx.service" ];
+ };
+ };
+}