global(fs): add zfs replication options

This commit is contained in:
514fpv 2024-02-10 00:57:35 +08:00
parent 740acdc152
commit 9d3600095c
Signed by: koishi
SSH key fingerprint: SHA256:axz0uIzzY+5W19i7QOUuiw5LSqhKfCBKPf3L4xFRxLw
2 changed files with 48 additions and 0 deletions

View file

@ -6,6 +6,7 @@
in {
imports = [
./split.nix
./replication.nix
];
# -o ashift=12
@ -42,6 +43,24 @@ in {
description = "UUID of store filesystem";
};
};
replication = {
enable = mkEnableOption "zfs replication to remote";
remote = mkOption {
type = with types; str;
description = "remote host as replication destination";
};
datasets = mkOption {
type = with types; listOf str;
default = [ "persist" "service" "storage" ];
description = "list of filesystems to perform replication for";
};
sendOptions = mkOption {
type = with types; str;
default = "w";
description = "send options for all datasets";
};
};
};
config = mkIf (cfg.type == "zfs") {