diff options
Diffstat (limited to '')
| -rw-r--r-- | nixos/hosts/apocalypse/backup.nix | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/nixos/hosts/apocalypse/backup.nix b/nixos/hosts/apocalypse/backup.nix new file mode 100644 index 0000000..de22bd3 --- /dev/null +++ b/nixos/hosts/apocalypse/backup.nix @@ -0,0 +1,30 @@ +{ config, lib, pkgs, modulesPath, ...}: +{ + services.btrbk = { + instances."remote_vault" = { + onCalendar = "weekly"; + settings = { + ssh_identity = "/etc/btrbk_key"; # NOTE: must be readable by user/group btrbk + ssh_user = "vault"; + stream_compress = "lz4"; + volume."/btrfs_root" = { + target = "ssh://10.100.0.1/vault/backups/apocalypse"; + subvolume = { + nixos = { + snapshot_create = "always"; + }; + }; + # "nixos" could instead be an attribute set with other volumes to + # back up and to give subvolume specific configuration. + # See man btrbk.conf for possible options. + /* + subvolume = { + home = { snapshot_create = "always"; }; + nixos = {}; + }; + */ + }; + }; + }; +}; +} |
