Add configs for a new kubernetes cluster on NixOS.
This commit is contained in:
55
nix/kubernetes/roles/zrepl/default.nix
Normal file
55
nix/kubernetes/roles/zrepl/default.nix
Normal file
@@ -0,0 +1,55 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
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 {
|
||||
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 = [
|
||||
{
|
||||
type = "grid";
|
||||
grid = "1x1h(keep=all) | 24x1h | 14x1d";
|
||||
regex = "^zrepl_.*";
|
||||
}
|
||||
{
|
||||
type = "regex";
|
||||
negate = true;
|
||||
regex = "^zrepl_.*";
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user