From eb06bbcf8b82b5a5aa488b00965d56d6dfe52b2d Mon Sep 17 00:00:00 2001 From: 514fpv Date: Sun, 3 Mar 2024 15:04:33 +0800 Subject: [PATCH] global(fs): add zfs replication custom ssh port --- global/fs/zfs/default.nix | 5 +++++ global/fs/zfs/replication.nix | 1 + 2 files changed, 6 insertions(+) diff --git a/global/fs/zfs/default.nix b/global/fs/zfs/default.nix index 70520af2..99e4f59c 100644 --- a/global/fs/zfs/default.nix +++ b/global/fs/zfs/default.nix @@ -50,6 +50,11 @@ in { type = with types; str; description = "remote host as replication destination"; }; + port = mkOption { + type = with types; port; + description = "ssh port of replication target"; + default = 22; + }; datasets = mkOption { type = with types; listOf str; default = [ "persist" "service" "storage" ]; diff --git a/global/fs/zfs/replication.nix b/global/fs/zfs/replication.nix index c8f58b44..f2edba41 100644 --- a/global/fs/zfs/replication.nix +++ b/global/fs/zfs/replication.nix @@ -11,6 +11,7 @@ in mkIf cfg.enable { commonArgs = [ "--recursive" "--mbuffer-size=128M" + "--sshport=${toString cfg.port}" ]; localSourceAllow = mkOptionDefault [ "mount" ];