61 lines
1.3 KiB
Nix
Raw Permalink Normal View History

2025-01-13 17:59:03 -05:00
{
config,
lib,
pkgs,
...
}:
{
imports = [ ];
2025-01-23 21:52:50 -05:00
options.me = {
zrepl.enable = lib.mkOption {
type = lib.types.bool;
default = false;
example = true;
description = "Whether we want to install zrepl.";
};
};
config = lib.mkIf config.me.zrepl.enable (
lib.mkMerge [
{
services.zrepl = {
enable = true;
settings = {
jobs = [
2025-01-13 17:59:03 -05:00
{
2025-01-23 21:52:50 -05:00
name = "snapjob";
type = "snap";
filesystems = {
"zroot/linux/nix/persist<" = true;
"zroot/bridge<" = true;
};
snapshotting = {
type = "periodic";
interval = "15m";
prefix = "zrepl_";
};
pruning = {
keep = [
{
type = "grid";
grid = "1x1h(keep=all) | 24x1h | 14x1d";
regex = "^zrepl_.*";
}
{
type = "regex";
negate = true;
regex = "^zrepl_.*";
}
];
};
2025-01-13 17:59:03 -05:00
}
];
};
2025-01-23 21:52:50 -05:00
};
}
]
);
2025-01-13 17:59:03 -05:00
}