Make zrepl a conditional install.

This commit is contained in:
Tom Alexander 2025-01-23 21:52:50 -05:00
parent 814769b3e9
commit 2ce4520cd6
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
3 changed files with 47 additions and 30 deletions

View File

@ -30,4 +30,5 @@
me.kodi.enable = true;
me.lvfs.enable = true;
me.sound.enable = true;
me.zrepl.enable = true;
}

View File

@ -57,4 +57,5 @@
me.vscode.enable = true;
me.wasm.enable = true;
me.waybar.enable = true;
me.zrepl.enable = true;
}

View File

@ -8,38 +8,53 @@
{
imports = [ ];
services.zrepl = {
enable = true;
settings = {
jobs = [
{
name = "snapjob";
type = "snap";
filesystems = {
"zroot/linux/nix/persist<" = true;
"zroot/bridge<" = true;
};
snapshotting = {
type = "periodic";
interval = "15m";
prefix = "zrepl_";
};
pruning = {
keep = [
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 = [
{
type = "grid";
grid = "1x1h(keep=all) | 24x1h | 14x1d";
regex = "^zrepl_.*";
}
{
type = "regex";
negate = true;
regex = "^zrepl_.*";
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_.*";
}
];
};
}
];
};
}
];
};
};
};
}
]
);
}