From a0c00480f39104d49d66cf1bdf8f6c0da39b0e50 Mon Sep 17 00:00:00 2001 From: Valentin Brandl Date: Thu, 1 Aug 2024 16:24:21 +0200 Subject: [PATCH] Simple btrbk config --- machines/morpheus.nix | 1 + machines/morpheus/btrbk.nix | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 machines/morpheus/btrbk.nix diff --git a/machines/morpheus.nix b/machines/morpheus.nix index 6dd13bf..582814a 100644 --- a/machines/morpheus.nix +++ b/machines/morpheus.nix @@ -15,6 +15,7 @@ inputs.nixpkgs.lib.nixosSystem { nixpkgs.overlays = [ overlay-unstable ]; }) (import ./common.nix inputs) + (import ./morpheus/btrbk.nix inputs) (import ./dev.nix inputs) (import ./entertainment.nix inputs) (import ./office.nix inputs) diff --git a/machines/morpheus/btrbk.nix b/machines/morpheus/btrbk.nix new file mode 100644 index 0000000..358728b --- /dev/null +++ b/machines/morpheus/btrbk.nix @@ -0,0 +1,25 @@ +{ ... }: { + services.btrbk = { + instances = { + home = { + settings = { + snapshot_preserve = "24h 14d 4w 12m"; + snapshot_preserve_min = "latest"; + + /* don't auto cleanup target */ + target_preserve_min = "all"; + + volume."/" = { + snapshot_dir = ".btrbk"; + subvolume = { + home = { + snapshot_create = "always"; + }; + }; + target = "/run/media/me/backup/morpheus"; + }; + }; + }; + }; + }; +}