From a6b3115d5de5ba05c405839e316be2172c5c3250 Mon Sep 17 00:00:00 2001 From: 514fpv Date: Sat, 10 Feb 2024 01:03:54 +0800 Subject: [PATCH] refactor(eientei): convert to global zfs replication --- spec/eientei/default.nix | 2 ++ spec/eientei/replication.nix | 43 ------------------------------------ 2 files changed, 2 insertions(+), 43 deletions(-) delete mode 100644 spec/eientei/replication.nix diff --git a/spec/eientei/default.nix b/spec/eientei/default.nix index a59baa1e..9e30aa89 100644 --- a/spec/eientei/default.nix +++ b/spec/eientei/default.nix @@ -9,6 +9,8 @@ fs.zfs.split.enable = true; fs.zfs.split.store = "d9202e56-a14f-4342-acdb-dbae33d680fc"; fs.zfs.split.secret = "1404c4f1-b890-4cf0-ab8a-26bd81bd2254"; + fs.zfs.replication.enable = true; + fs.zfs.replication.remote = "koishi@archive:archive/backup/koishi/eientei"; fs.cryptsetup.enable = true; fs.cryptsetup.allowDiscards = false; fs.cryptsetup.uuids.secret = "c33c9b18-a280-42d7-8740-3f8d3f60dc43"; diff --git a/spec/eientei/replication.nix b/spec/eientei/replication.nix deleted file mode 100644 index 9611807c..00000000 --- a/spec/eientei/replication.nix +++ /dev/null @@ -1,43 +0,0 @@ -{ - services.syncoid = { - enable = true; - interval = "daily"; - sshKey = "/var/lib/syncoid/.ssh/id_ed25519"; - commonArgs = [ - "--recursive" - #"--use-hold" - "--compress=lz4" - "--mbuffer-size=128M" - ]; - localSourceAllow = [ - "bookmark" - "hold" - "send" - "snapshot" - "destroy" - "mount" - ]; - - commands = let - sendOptions = "w"; - remote = "koishi@archive:archive/backup/koishi/eientei"; - in { - "eientei/persist" = { - inherit sendOptions; - target = "${remote}/persist"; - }; - "eientei/service" = { - inherit sendOptions; - target = "${remote}/service"; - }; - "eientei/storage" = { - inherit sendOptions; - target = "${remote}/storage"; - }; - }; - }; - - users.users.syncoid.uid = 82; - users.groups.syncoid.gid = 82; - environment.persistence."/nix/persist/fhs".directories = [ "/var/lib/syncoid" ]; -}