nixos-config/machines/chungus/sync-syncoid.nix
2024-06-07 22:56:52 +02:00

56 lines
1.7 KiB
Nix

{ pkgs, config, factsGenerator, ... }:
let
tld = config.clan.static-hosts.topLevelDomain;
in
{
clanCore.facts.services.syncoid = factsGenerator.ssh { name = "syncoid"; };
systemd.tmpfiles.settings.syncoid = {
"/run/facts/ssh.syncoid.id_ed25519"."C+" = {
user = config.services.syncoid.user;
group = config.services.syncoid.group;
mode = "400";
argument = config.clanCore.facts.services.syncoid.secret."ssh.syncoid.id_ed25519".path;
};
};
services.syncoid = {
enable = true;
# local
commands.service2 = {
source = "zroot/services2";
target = "zraid/mirror/services2"; # should not be created up front!
};
commands.paperless = {
source = "zroot/paperless";
target = "zraid/mirror/paperless"; # should not be created up front!
};
commands.postgresql = {
source = "zroot/postgresql";
target = "zraid/mirror/postgresql"; # should not be created up front!
};
# remote
commands.matrix-terranix = {
sshKey = "/run/facts/ssh.syncoid.id_ed25519";
source = "root@orbi.${tld}:zroot/matrix-terranix";
target = "zraid/mirror/matrix-terranix"; # should not be created up front!
};
commands.nextcloud = {
sshKey = "/run/facts/ssh.syncoid.id_ed25519";
source = "root@orbi.${tld}:zroot/nextcloud";
target = "zraid/mirror/nextcloud"; # should not be created up front!
};
commands.photoprism = {
sshKey = "/run/facts/ssh.syncoid.id_ed25519";
source = "root@orbi.${tld}:zmedia/photoprism";
target = "zraid/mirror/photoprism"; # should not be created up front!
};
commonArgs = [
# Does not create new snapshot, only transfers existing
"--no-sync-snap"
];
};
}