From 8d319257d2b5bd793ab5b5b78994ffe95ca629ae Mon Sep 17 00:00:00 2001
From: Andre <andre@8bitbuddhism.com>
Date: Mon, 2 Dec 2024 13:08:35 -0500
Subject: [PATCH] Hevana: re-enable weekly builds for Khanda (yes, again)

---
 hosts/Hevana/default.nix | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/hosts/Hevana/default.nix b/hosts/Hevana/default.nix
index 6aecef1..4850d7e 100644
--- a/hosts/Hevana/default.nix
+++ b/hosts/Hevana/default.nix
@@ -61,6 +61,29 @@ in
     ];
   };
 
+  # Build Nix packages for other hosts.
+  # Runs every Saturday morning at 4 AM
+  systemd.services."build-hosts" = {
+    serviceConfig = {
+      Type = "oneshot";
+      User = "aires";
+    };
+    path = config.aux.system.corePackages;
+    script = ''
+      /run/current-system/sw/bin/nixos-operations-script --operation build --hostname Khanda
+    '';
+  };
+  systemd.timers."build-hosts" = {
+    wants = [ "network-online.target" ];
+    after = [ "network-online.target" ];
+    wantedBy = [ "timers.target" ];
+    timerConfig = {
+      OnCalendar = "Sat, 04:00";
+      Persistent = true;
+      Unit = "build-hosts.service";
+    };
+  };
+
   # Configure the system.
   aux.system = {
     # Enable to allow unfree (e.g. closed source) packages.