Initialize quasar
This commit is contained in:
parent
60579facc7
commit
211af9bd61
15 changed files with 616 additions and 72 deletions
76
linux/quasar/zfs.nix
Normal file
76
linux/quasar/zfs.nix
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
boot.loader.grub.zfsSupport = true;
|
||||
|
||||
services.zfs = {
|
||||
autoScrub.enable = true;
|
||||
trim.enable = true;
|
||||
};
|
||||
|
||||
services.zrepl = {
|
||||
enable = true;
|
||||
settings = {
|
||||
global = {
|
||||
logging = [
|
||||
{
|
||||
type = "syslog";
|
||||
level = "info";
|
||||
format = "human";
|
||||
}
|
||||
];
|
||||
};
|
||||
jobs = let
|
||||
listener_name = "archive";
|
||||
in [
|
||||
{
|
||||
type = "push";
|
||||
name = "snapshot";
|
||||
connect = {
|
||||
inherit listener_name;
|
||||
type = "local";
|
||||
client_identity = config.networking.hostName;
|
||||
};
|
||||
filesystems."zactive/main/home" = true;
|
||||
send.encrypted = true;
|
||||
snapshotting = {
|
||||
type = "periodic";
|
||||
prefix = "zrepl-";
|
||||
interval = "1h";
|
||||
};
|
||||
pruning = {
|
||||
keep_sender = [
|
||||
{
|
||||
type = "grid";
|
||||
regex = "^zrepl-.*";
|
||||
grid = lib.concatStringsSep " | " ["1x1h(keep=all)" "24x1h" "7x1d" "4x1w"];
|
||||
}
|
||||
];
|
||||
keep_receiver = [
|
||||
{
|
||||
type = "grid";
|
||||
regex = "^zrepl-.*";
|
||||
grid = lib.concatStringsSep " | " ["1x1h(keep=all)" "30x1d" "52x1w"];
|
||||
}
|
||||
];
|
||||
};
|
||||
replication.protection = {
|
||||
initial = "guarantee_resumability";
|
||||
incremental = "guarantee_incremental";
|
||||
};
|
||||
}
|
||||
{
|
||||
type = "sink";
|
||||
name = "archive";
|
||||
serve = {
|
||||
inherit listener_name;
|
||||
type = "local";
|
||||
};
|
||||
root_fs = "zarchive";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue