23 lines
688 B
Nix
23 lines
688 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";
|
|
};
|
|
services.openssh.knownHosts."zfs-backup.vsinerva.fi".publicKey =
|
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOWGvIc4sq+WzPqT2y003zga3StMgj7F8vwTjNkZ//d8";
|
|
};
|
|
}
|