Clean branch
This commit is contained in:
commit
de986accc2
42 changed files with 1959 additions and 0 deletions
83
linux/blitzar/zfs.nix
Normal file
83
linux/blitzar/zfs.nix
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
{ config, lib, ... }: {
|
||||
|
||||
boot = {
|
||||
kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages;
|
||||
loader.grub.zfsSupport = true;
|
||||
zfs.enableUnstable = true;
|
||||
};
|
||||
|
||||
services.zfs = {
|
||||
autoScrub.enable = true;
|
||||
trim.enable = true;
|
||||
};
|
||||
|
||||
services.zrepl = {
|
||||
enable = true;
|
||||
settings = {
|
||||
global = {
|
||||
logging = [{
|
||||
type = "syslog";
|
||||
level = "info";
|
||||
format = "human";
|
||||
}];
|
||||
};
|
||||
jobs = [
|
||||
{
|
||||
name = "snapshot";
|
||||
type = "snap";
|
||||
filesystems = { "zroot/main/home" = true; };
|
||||
snapshotting = {
|
||||
type = "periodic";
|
||||
prefix = "zrepl-";
|
||||
interval = "1h";
|
||||
};
|
||||
pruning = {
|
||||
keep = [{
|
||||
type = "grid";
|
||||
regex = "^zrepl-.*";
|
||||
grid = lib.concatStringsSep " | " [ "1x1h(keep=all)" "24x1h" "7x1d" "4x1w" ];
|
||||
}];
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "push-to-local-drive";
|
||||
type = "push";
|
||||
send = { encrypted = true; };
|
||||
connect = {
|
||||
type = "local";
|
||||
listener_name = "sink-to-local-drive";
|
||||
client_identity = config.networking.hostName;
|
||||
};
|
||||
filesystems = { "zroot/main/home" = true; };
|
||||
replication = {
|
||||
protection = {
|
||||
initial = "guarantee_resumability";
|
||||
incremental = "guarantee_incremental";
|
||||
};
|
||||
};
|
||||
snapshotting = { type = "manual"; };
|
||||
pruning = {
|
||||
keep_sender = [{ type = "regex"; regex = ".*"; }];
|
||||
keep_receiver = [{
|
||||
type = "grid";
|
||||
regex = "^zrepl-.*";
|
||||
grid = lib.concatStringsSep " | " [ "1x1h(keep=all)" "365x1d" "52x1w" ];
|
||||
}];
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "sink-to-local-drive";
|
||||
type = "sink";
|
||||
recv = { placeholder = { encryption = "off"; }; };
|
||||
root_fs = "zbackup";
|
||||
serve = {
|
||||
type = "local";
|
||||
listener_name = "sink-to-local-drive";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue