From 54c04f9c029c3810e99994b7def4b2fe484d1f4a Mon Sep 17 00:00:00 2001 From: Julia Lange Date: Wed, 6 Aug 2025 19:47:17 -0700 Subject: [PATCH] Break juri apart and add scaffolding for system timers --- hosts/juri/bskyannouncements.nix | 23 ++++++++++ hosts/juri/host.nix | 74 +++----------------------------- hosts/juri/webservices.nix | 66 ++++++++++++++++++++++++++++ 3 files changed, 96 insertions(+), 67 deletions(-) create mode 100644 hosts/juri/bskyannouncements.nix create mode 100644 hosts/juri/webservices.nix diff --git a/hosts/juri/bskyannouncements.nix b/hosts/juri/bskyannouncements.nix new file mode 100644 index 0000000..1090f0e --- /dev/null +++ b/hosts/juri/bskyannouncements.nix @@ -0,0 +1,23 @@ +{ pkgs, ... }: +{ + systemd.timers."bsky-announcements" = { + wantedBy = [ "timers.target" ]; + timerConfig = { + OnBootSec = "20s"; + # OnCalendar = "Thu *-*-* 8:00:00 America/Los_Angeles"; + # Persistent = true; + Unit = "bsky-announcements.service"; + }; + }; + + systemd.services."bsky-announcements" = { + script = '' + set -eu + ${pkgs.coreutils}/bin/echo "Hello World" + ''; + serviceConfig = { + Type = "oneshot"; + User = "root"; + }; + }; +} diff --git a/hosts/juri/host.nix b/hosts/juri/host.nix index be01321..aa6a1aa 100644 --- a/hosts/juri/host.nix +++ b/hosts/juri/host.nix @@ -1,9 +1,10 @@ -{ config, ... }: -let - email = "admin@woach.me"; -in { - imports = [ - ./hardware.nix ]; +{ ... }: +{ + imports = [ + ./hardware.nix + ./webservices.nix + ./bskyannouncements.nix + ]; system.stateVersion = "24.11"; system.timezone = "America/Los_Angeles"; system.users.bigWheels = [ "pan" ]; @@ -20,67 +21,6 @@ in { }; }; - caddy = { - enable = true; - adminEmail = email; - vhosts = { - "juri.woach.me" = { - extraConfig = '' - reverse_proxy :3000 - ''; - serverAliases = [ "*.juri.woach.me" ]; - }; - "winry.woach.me" = { - extraConfig = '' - reverse_proxy :${builtins.toString config.forgejo.server.port} - ''; - }; - "ginko.woach.me" = { - extraConfig = '' - reverse_proxy :${builtins.toString config.headscale.server.port} - ''; - }; - }; - }; - - pds = { - enable = true; - hostname = "juri.woach.me"; - adminEmail = email; - environmentFile = config.sops.secrets.pdsEnv.path; - }; - - forgejo = { - enable = true; - server.domain = "winry.woach.me"; - users.admin = { - enable = true; - username = "Julia"; - passwordFile = config.sops.secrets.forgejoPassword.path; - }; - }; - - headscale = { - enable = true; - server.domain = "ginko.woach.me"; - }; - - syncthing = { - enable = true; - devices = { - "homura".id = "NEP24DB-DVXAHTZ-TCCNREQ-Q5TSC7K-ZXPWC4L-5ELGKQX-4I2P47O-2FT5QAU"; - "onizuka".id = "5S6QMND-MHD2HYR-DR6KQD4-6AWJTRL-FQUCR7W-FD2KBT3-AF6RE6R-F47KBQC"; - }; - - folders = { - "wiki" = { - path = "/var/lib/wiki"; - devices = [ "homura" "onizuka" ]; - }; - }; - }; - systemd.tmpfiles.rules = [ "d /var/lib/wiki 0755 syncthing syncthing -" ]; - postgres.enable = true; shell.enabledShells = [ "fish" ]; diff --git a/hosts/juri/webservices.nix b/hosts/juri/webservices.nix new file mode 100644 index 0000000..3b08f9c --- /dev/null +++ b/hosts/juri/webservices.nix @@ -0,0 +1,66 @@ +{ config, ... }: +let + email = "admin@woach.me"; +in { + caddy = { + enable = true; + adminEmail = email; + vhosts = { + "juri.woach.me" = { + extraConfig = '' + reverse_proxy :3000 + ''; + serverAliases = [ "*.juri.woach.me" ]; + }; + "winry.woach.me" = { + extraConfig = '' + reverse_proxy :${builtins.toString config.forgejo.server.port} + ''; + }; + "ginko.woach.me" = { + extraConfig = '' + reverse_proxy :${builtins.toString config.headscale.server.port} + ''; + }; + }; + }; + + pds = { + enable = true; + hostname = "juri.woach.me"; + adminEmail = email; + environmentFile = config.sops.secrets.pdsEnv.path; + }; + + forgejo = { + enable = true; + server.domain = "winry.woach.me"; + users.admin = { + enable = true; + username = "Julia"; + passwordFile = config.sops.secrets.forgejoPassword.path; + }; + }; + + headscale = { + enable = true; + server.domain = "ginko.woach.me"; + }; + + syncthing = { + enable = true; + devices = { + "homura".id = "NEP24DB-DVXAHTZ-TCCNREQ-Q5TSC7K-ZXPWC4L-5ELGKQX-4I2P47O-2FT5QAU"; + "onizuka".id = "5S6QMND-MHD2HYR-DR6KQD4-6AWJTRL-FQUCR7W-FD2KBT3-AF6RE6R-F47KBQC"; + }; + + folders = { + "wiki" = { + path = "/var/lib/wiki"; + devices = [ "homura" "onizuka" ]; + }; + }; + }; + systemd.tmpfiles.rules = [ "d /var/lib/wiki 0755 syncthing syncthing -" ]; + +}