mirror of
https://github.com/oddlama/nix-config.git
synced 2025-10-11 07:10:39 +02:00
feat(ward): local snapshotting via zrepl
This commit is contained in:
parent
78987715c2
commit
b7378d38de
1 changed files with 65 additions and 0 deletions
|
@ -32,5 +32,70 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
services.zrepl = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
global = {
|
||||||
|
logging = [
|
||||||
|
{
|
||||||
|
type = "syslog";
|
||||||
|
level = "info";
|
||||||
|
format = "human";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
# TODO zrepl monitor
|
||||||
|
#monitoring = [
|
||||||
|
# {
|
||||||
|
# type = "prometheus";
|
||||||
|
# listen = ":9811";
|
||||||
|
# listen_freebind = true;
|
||||||
|
# }
|
||||||
|
#];
|
||||||
|
};
|
||||||
|
|
||||||
|
jobs = [
|
||||||
|
{
|
||||||
|
name = "local-snapshots";
|
||||||
|
type = "snap";
|
||||||
|
filesystems = {
|
||||||
|
"rpool/local/state<" = true;
|
||||||
|
"rpool/safe<" = true;
|
||||||
|
};
|
||||||
|
snapshotting = {
|
||||||
|
type = "periodic";
|
||||||
|
prefix = "zrepl-";
|
||||||
|
timestamp_format = "iso-8601";
|
||||||
|
interval = "15m";
|
||||||
|
};
|
||||||
|
pruning.keep = [
|
||||||
|
# Keep all manual snapshots
|
||||||
|
{
|
||||||
|
type = "regex";
|
||||||
|
regex = "^zrepl-.*$";
|
||||||
|
negate = true;
|
||||||
|
}
|
||||||
|
# Keep last n snapshots
|
||||||
|
{
|
||||||
|
type = "last_n";
|
||||||
|
regex = "^zrepl-.*$";
|
||||||
|
count = 10;
|
||||||
|
}
|
||||||
|
# Prune periodically
|
||||||
|
{
|
||||||
|
type = "grid";
|
||||||
|
regex = "^zrepl-.*$";
|
||||||
|
grid = lib.concatStringsSep " | " [
|
||||||
|
"72x1h"
|
||||||
|
"90x1d"
|
||||||
|
"60x1w"
|
||||||
|
"24x30d"
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
boot.initrd.luks.devices.enc-rpool.allowDiscards = true;
|
boot.initrd.luks.devices.enc-rpool.allowDiscards = true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue