diff --git a/nix/configuration/configuration.nix b/nix/configuration/configuration.nix index 90f318a..430e237 100644 --- a/nix/configuration/configuration.nix +++ b/nix/configuration/configuration.nix @@ -24,6 +24,7 @@ ./roles/network ./roles/firewall ./roles/zsh + ./roles/zrepl ./roles/graphics ./roles/sound ./roles/sway diff --git a/nix/configuration/roles/zrepl/default.nix b/nix/configuration/roles/zrepl/default.nix new file mode 100644 index 0000000..3801762 --- /dev/null +++ b/nix/configuration/roles/zrepl/default.nix @@ -0,0 +1,45 @@ +{ + config, + lib, + pkgs, + ... +}: + +{ + 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 = [ + { + type = "grid"; + grid = "1x1h(keep=all) | 24x1h | 14x1d"; + regex = "^zrepl_.*"; + } + { + type = "regex"; + negate = true; + regex = "^zrepl_.*"; + } + ]; + }; + } + ]; + }; + }; +}