Break juri apart and add scaffolding for system timers

This commit is contained in:
Julia Lange 2025-08-06 19:47:17 -07:00
parent 863101b6f6
commit 54c04f9c02
Signed by: Julia
SSH key fingerprint: SHA256:KI8YxpkPRbnDRkXPgCuQCVz181++Vy7NAvmQj8alOhM
3 changed files with 96 additions and 67 deletions

View file

@ -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";
};
};
}

View file

@ -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" ];

View file

@ -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 -" ];
}