nixos-conf/modules/services/zfs-replication.nix

21 lines
529 B
Nix

{ config, lib, ... }:
let
cfg = config.custom.services.zfsReplication;
in
{
options.custom.services.zfsReplication.enable = lib.mkOption {
type = lib.types.bool;
default = false;
};
config = lib.mkIf cfg.enable {
services.zfs.autoReplication = {
enable = true;
host = "zfs-backup.vsinerva.fi";
identityFilePath = "/etc/ssh/ssh_host_ed25519_key";
localFilesystem = "zroot";
remoteFilesystem = "zroot/backups/${config.networking.hostName}";
username = "root";
};
};
}