diff --git a/systems/x86_64-linux/marvin/default.nix b/systems/x86_64-linux/marvin/default.nix index 6b7fdb46..066d0f08 100644 --- a/systems/x86_64-linux/marvin/default.nix +++ b/systems/x86_64-linux/marvin/default.nix @@ -13,6 +13,7 @@ ./services/avahi.nix ./services/bots.nix ./services/deemix.nix + ./services/gdq-cals.nix ./services/git.nix ./services/golink.nix ./services/grafana.nix diff --git a/systems/x86_64-linux/marvin/services/gdq-cals.nix b/systems/x86_64-linux/marvin/services/gdq-cals.nix new file mode 100644 index 00000000..9c8188ad --- /dev/null +++ b/systems/x86_64-linux/marvin/services/gdq-cals.nix @@ -0,0 +1,38 @@ +{ + lib, + pkgs, + ... +}: +let + pyWithLibs = pkgs.python312.withPackages (ps: [ + ps.pytz + ps.icalendar + ps.requests + ps.google-auth-oauthlib + ps.google-api-python-client + ]); +in +{ + config.systemd = { + services.gdq-calendars = { + wantedBy = [ "multi-user.target" ]; + description = "GDQ Calendar Updater"; + path = [ pyWithLibs ]; + serviceConfig = { + ExecStart = "${lib.getExe pyWithLibs} gdq_cal_ics_exporter.py --id 56 --fatales --gcal"; + Type = "oneshot"; + WorkingDirectory = "/home/thehedgehog/gdq-cals/"; + User = "thehedgehog"; + Group = "users"; + RemainAfterExit = true; + }; + }; + timers.gdq-calendars = { + wantedBy = [ "timers.target" ]; + timerConfig = { + OnCalendar = "*-*-* */2:00:00"; + Unit = "gdq-calendars.service"; + }; + }; + }; +}