2024-05-31 22:02:52 +02:00
|
|
|
{ pkgs, config, ... }:
|
2023-08-28 22:53:55 +02:00
|
|
|
{
|
2024-05-11 00:20:55 +02:00
|
|
|
|
2024-05-31 21:02:22 +02:00
|
|
|
clanCore.facts.services.syncoid = {
|
|
|
|
secret."syncoid.ssh.id_ed25519" = { };
|
|
|
|
public."syncoid.ssh.id_ed25519.pub" = { };
|
|
|
|
generator.path = with pkgs; [ coreutils openssh ];
|
|
|
|
generator.script = ''
|
|
|
|
ssh-keygen -t ed25519 -N "" -f $secrets/syncoid.ssh.id_ed25519
|
2024-05-31 22:02:52 +02:00
|
|
|
mv $secrets/syncoid.ssh.id_ed25519.pub $facts/syncoid.ssh.id_ed25519.pub
|
2024-05-31 21:02:22 +02:00
|
|
|
'';
|
2024-05-11 00:20:55 +02:00
|
|
|
};
|
|
|
|
|
2023-08-28 22:53:55 +02:00
|
|
|
services.syncoid = {
|
|
|
|
enable = true;
|
2024-05-15 22:54:12 +02:00
|
|
|
|
|
|
|
# local
|
2023-08-28 22:53:55 +02:00
|
|
|
commands.service2 = {
|
|
|
|
source = "zroot/services2";
|
2024-03-11 15:33:26 +01:00
|
|
|
target = "zraid/mirror/services2"; # should not be created up front!
|
2024-03-11 12:33:40 +01:00
|
|
|
};
|
|
|
|
commands.paperless = {
|
|
|
|
source = "zroot/paperless";
|
2024-03-11 15:33:26 +01:00
|
|
|
target = "zraid/mirror/paperless"; # should not be created up front!
|
2024-03-11 12:33:40 +01:00
|
|
|
};
|
|
|
|
commands.postgresql = {
|
|
|
|
source = "zroot/postgresql";
|
2024-03-11 15:33:26 +01:00
|
|
|
target = "zraid/mirror/postgresql"; # should not be created up front!
|
2023-08-28 22:53:55 +02:00
|
|
|
};
|
2024-05-15 22:54:12 +02:00
|
|
|
|
|
|
|
# remote
|
2024-05-19 01:17:45 +02:00
|
|
|
commands.matrix-terranix = {
|
2024-05-31 21:02:22 +02:00
|
|
|
sshKey = config.clanCore.facts.services.syncoid.secret."syncoid.ssh.id_ed25519".path;
|
2024-05-19 01:17:45 +02:00
|
|
|
source = "root@orbi:zroot/matrix-terranix";
|
|
|
|
target = "zraid/mirror/matrix-terranix"; # should not be created up front!
|
|
|
|
};
|
|
|
|
commands.nextcloud = {
|
2024-05-31 21:02:22 +02:00
|
|
|
sshKey = config.clanCore.facts.services.syncoid.secret."syncoid.ssh.id_ed25519".path;
|
2024-05-19 01:17:45 +02:00
|
|
|
source = "root@orbi:zroot/nextcloud";
|
|
|
|
target = "zraid/mirror/nextcloud"; # should not be created up front!
|
|
|
|
};
|
2024-05-11 00:20:55 +02:00
|
|
|
commands.photoprism = {
|
2024-05-31 21:02:22 +02:00
|
|
|
sshKey = config.clanCore.facts.services.syncoid.secret."syncoid.ssh.id_ed25519".path;
|
2024-05-11 00:20:55 +02:00
|
|
|
source = "root@orbi:zmedia/photoprism";
|
|
|
|
target = "zraid/mirror/photoprism"; # should not be created up front!
|
|
|
|
};
|
2023-08-28 22:53:55 +02:00
|
|
|
commonArgs = [
|
2024-03-11 12:33:40 +01:00
|
|
|
# Does not create new snapshot, only transfers existing
|
2023-08-28 22:53:55 +02:00
|
|
|
"--no-sync-snap"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|