Commit f0fee66b14fe

Vincent Demeester <vincent@sbr.pm>
2019-12-20 13:31:52
machine/honshu: migrate hokkaido to honshu ๐ŸŽฅ
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent cac0d87
Changed files (1)
machine
machine/honshu.nix
@@ -32,4 +32,53 @@ with import ../assets/machines.nix; {
       endpointPublicKey = wireguard.kerkouane.publicKey;
     };
   };
+  # -----------------------------------
+  environment.etc."vrsync".text = ''
+/home/vincent/desktop/pictures/screenshots/ vincent@synodine.home:/volumeUSB2/usbshare/pictures/screenshots/
+/home/vincent/desktop/pictures/wallpapers/ vincent@synodine.home:/volumeUSB2/usbshare/pictures/wallpapers/
+/home/vincent/desktop/documents/ vincent@synodine.home:/volume1/documents/
+/mnt/Toshito/photos/ vincent@synodine.home:/volumeUSB2/usbshare/pictures/photos/
+/mnt/Toshito/music/ vincent@synodine.home:/volumeUSB2/usbshare/music/
+  '';
+  systemd.services.vrsync = {
+    description = "vrsync - sync folders to NAS";
+    requires = [ "network-online.target" ];
+    after    = [ "network-online.target" ];
+
+    unitConfig.X-StopOnRemoval = false;
+    restartIfChanged = false;
+
+    path = with pkgs; [ rsync coreutils bash openssh ];
+    script = ''
+    ${pkgs.vrsync}/bin/vrsync
+    '';
+
+    startAt = "hourly";
+    serviceConfig = {
+      Type = "oneshot";
+      OnFailure = "status-email-root@%n.service";
+    };
+  };
+  # ape โ€“ sync git mirrors
+  systemd.services.ape = {
+    description = "Ape - sync git mirrors";
+    requires = [ "network-online.target" ];
+    after    = [ "network-online.target" ];
+
+    restartIfChanged = false;
+    unitConfig.X-StopOnRemoval = false;
+
+    serviceConfig = {
+      Type = "oneshot";
+      User = "vincent";
+      OnFailure = "status-email-root@%n.service";
+    };
+
+    path = with pkgs; [ git ];
+    script = ''
+    ${pkgs.nur.repos.vdemeester.ape}/bin/ape up /home/vincent/var/mirrors
+    '';
+
+    startAt = "hourly";
+  };
 }