diff --git a/hosts/marvin/services/go-jamming.nix b/hosts/marvin/services/go-jamming.nix index d508c9f..b04ab2e 100644 --- a/hosts/marvin/services/go-jamming.nix +++ b/hosts/marvin/services/go-jamming.nix @@ -9,11 +9,11 @@ "thehedgehog.me", "blog.thehedgehog.me", "mrhedgehog.xyz", - "mrhedgehog.blog", + "mrhedgehog.blog" ], "blacklist": [ "youtube.com" - ], + ] } ''; in { @@ -27,7 +27,7 @@ in { Group = "go-jamming"; WorkingDirectory = "/var/lib/go-jamming"; ExecStart = "${pkgs.my-pkgs.go-jamming}/bin/go-jamming"; - ExecStartPre = "cp -f ${config} /var/lib/go-jamming/config.json"; + ExecStartPre = "if [ ! -d "/var/lib/go-jamming" ]; then mkdir /var/lib/go-jamming; fi; cp -f ${config} /var/lib/go-jamming/config.json"; SuccessExitStatus = 0; }; }; diff --git a/hosts/prefect/services/blog-update.nix b/hosts/prefect/services/blog-update.nix new file mode 100644 index 0000000..20a9d0e --- /dev/null +++ b/hosts/prefect/services/blog-update.nix @@ -0,0 +1,31 @@ +{pkgs, ...}: { + systemd.timers.blog-update = { + after = [ "network.target" ]; + wantedBy = [ "multi-user.target" ]; + description = "Blog Update Timer"; + timerConfig = { + Unit = "blog-update.service"; + OnUnitActiveSec = 3600; + }; + }; + + systemd.services.blog-update = { + wantedBy = [ "multi-user.target" ]; + description = "Blog Update Service"; + path = [ + "${pkgs.hugo}/bin" + "${pkgs.go}/bin" + "${pkgs.nodejs}/bin" + ]; + environment = { + NODE_ENV = "production"; + WEBMENTION_TOKEN = "VeryCoolToken"; + }; + serviceConfig = { + User = "caddy"; + Type = "oneshot"; + ExecStart = "cd blog && npm install && hugo -d out && cp -fvr out/ /var/www/blog/ && exit 0"; + }; + }; +} + diff --git a/hosts/prefect/services/caddy.nix b/hosts/prefect/services/caddy.nix index 8266b8d..be3a26c 100644 --- a/hosts/prefect/services/caddy.nix +++ b/hosts/prefect/services/caddy.nix @@ -13,6 +13,15 @@ http_port 81 ''; virtualHosts = { + # My blog/about page + "thehedgehog.me" = { + extraConfig = '' + file_server { + root /var/www/blog/ + } + ''; + }; + # Adguard Home - Adblocking DNS Server "adguard.thehedgehog.me" = { extraConfig = '' diff --git a/hosts/prefect/services/nsd/thehedgehog.me.nix b/hosts/prefect/services/nsd/thehedgehog.me.nix index 57f631b..0057565 100644 --- a/hosts/prefect/services/nsd/thehedgehog.me.nix +++ b/hosts/prefect/services/nsd/thehedgehog.me.nix @@ -2,7 +2,7 @@ SOA = { nameServer = "ns1.thehedgehog.me."; adminEmail = "me@thehedgehog.me"; - serial = 2022071014; + serial = 2022071201; # Refresh the records every hour refresh = 3600; # If retry fails, retry after 10 minutes @@ -103,6 +103,7 @@ sync = prefect; todo = prefect; vpn = prefect; + wm = prefect; # Externally hosted services ## Statuspage, hosted at PikaPods