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.kodi.enable = true;
me.lvfs.enable = true; me.lvfs.enable = true;
me.sound.enable = true; me.sound.enable = true;
me.zrepl.enable = true;
} }

View File

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

View File

@ -8,38 +8,53 @@
{ {
imports = [ ]; imports = [ ];
services.zrepl = { options.me = {
enable = true; zrepl.enable = lib.mkOption {
settings = { type = lib.types.bool;
jobs = [ default = false;
{ example = true;
name = "snapjob"; description = "Whether we want to install zrepl.";
type = "snap"; };
filesystems = { };
"zroot/linux/nix/persist<" = true;
"zroot/bridge<" = true; config = lib.mkIf config.me.zrepl.enable (
}; lib.mkMerge [
snapshotting = { {
type = "periodic"; services.zrepl = {
interval = "15m"; enable = true;
prefix = "zrepl_"; settings = {
}; jobs = [
pruning = {
keep = [
{ {
type = "grid"; name = "snapjob";
grid = "1x1h(keep=all) | 24x1h | 14x1d"; type = "snap";
regex = "^zrepl_.*"; filesystems = {
} "zroot/linux/nix/persist<" = true;
{ "zroot/bridge<" = true;
type = "regex"; };
negate = true; snapshotting = {
regex = "^zrepl_.*"; type = "periodic";
interval = "15m";
prefix = "zrepl_";
};
pruning = {
keep = [
{
type = "grid";
grid = "1x1h(keep=all) | 24x1h | 14x1d";
regex = "^zrepl_.*";
}
{
type = "regex";
negate = true;
regex = "^zrepl_.*";
}
];
};
} }
]; ];
}; };
} };
]; }
}; ]
}; );
} }