Restructure flake.nix for a simpler config for building different images off the same NixOS config.
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
@@ -17,44 +16,40 @@
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf config.me.zrepl.enable (
|
||||
lib.mkMerge [
|
||||
{
|
||||
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_.*";
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
]
|
||||
);
|
||||
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