nixos-config/machines/chungus/sync-syncoid.nix
Ingolf Wagner 403e3165b1
All checks were successful
Build all NixOS Configurations / nix build (push) Successful in 8m37s
🔧 backup forgejo
2024-10-13 02:25:00 +09:00

71 lines
2.1 KiB
Nix

{
pkgs,
config,
factsGenerator,
...
}:
let
tld = config.clan.static-hosts.topLevelDomain;
in
{
clan.core.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.clan.core.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!
};
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!
};
commands.forgejo = {
sshKey = "/run/facts/ssh.syncoid.id_ed25519";
source = "root@orbi.${tld}:zroot/forgejo";
target = "zraid/mirror/forgejo"; # should NOT be created up front!
};
commonArgs = [
# Does not create new snapshot, only transfers existing
"--no-sync-snap"
];
};
}