2024-08-29 03:26:04 +02:00
|
|
|
{
|
|
|
|
pkgs,
|
|
|
|
config,
|
|
|
|
factsGenerator,
|
|
|
|
...
|
|
|
|
}:
|
2024-06-06 01:48:15 +02:00
|
|
|
let
|
|
|
|
tld = config.clan.static-hosts.topLevelDomain;
|
|
|
|
in
|
2023-08-28 22:53:55 +02:00
|
|
|
{
|
2024-05-11 00:20:55 +02:00
|
|
|
|
2024-06-19 13:19:55 +02:00
|
|
|
clan.core.facts.services.syncoid = factsGenerator.ssh { name = "syncoid"; };
|
2024-06-06 01:48:15 +02:00
|
|
|
systemd.tmpfiles.settings.syncoid = {
|
|
|
|
"/run/facts/ssh.syncoid.id_ed25519"."C+" = {
|
|
|
|
user = config.services.syncoid.user;
|
|
|
|
group = config.services.syncoid.group;
|
|
|
|
mode = "400";
|
2024-06-19 13:19:55 +02:00
|
|
|
argument = config.clan.core.facts.services.syncoid.secret."ssh.syncoid.id_ed25519".path;
|
2024-06-06 01:48:15 +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-09-03 13:20:29 +02: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-09-03 13:20:29 +02: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-09-03 13:20:29 +02: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-06-06 01:48:15 +02:00
|
|
|
sshKey = "/run/facts/ssh.syncoid.id_ed25519";
|
|
|
|
source = "root@orbi.${tld}:zroot/matrix-terranix";
|
2024-09-03 13:20:29 +02:00
|
|
|
target = "zraid/mirror/matrix-terranix"; # should NOT be created up front!
|
2024-05-19 01:17:45 +02:00
|
|
|
};
|
|
|
|
commands.nextcloud = {
|
2024-06-06 01:48:15 +02:00
|
|
|
sshKey = "/run/facts/ssh.syncoid.id_ed25519";
|
|
|
|
source = "root@orbi.${tld}:zroot/nextcloud";
|
2024-09-03 13:20:29 +02:00
|
|
|
target = "zraid/mirror/nextcloud"; # should NOT be created up front!
|
2024-05-19 01:17:45 +02:00
|
|
|
};
|
2024-05-11 00:20:55 +02:00
|
|
|
commands.photoprism = {
|
2024-06-06 01:48:15 +02:00
|
|
|
sshKey = "/run/facts/ssh.syncoid.id_ed25519";
|
|
|
|
source = "root@orbi.${tld}:zmedia/photoprism";
|
2024-09-03 13:20:29 +02:00
|
|
|
target = "zraid/mirror/photoprism"; # should NOT be created up front!
|
|
|
|
};
|
|
|
|
commands.taskchampion = {
|
|
|
|
sshKey = "/run/facts/ssh.syncoid.id_ed25519";
|
|
|
|
source = "root@orbi.${tld}:zroot/taskchampion";
|
|
|
|
target = "zraid/mirror/taskchampion"; # should NOT be created up front!
|
2024-05-11 00:20:55 +02:00
|
|
|
};
|
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"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|