zfs autosnapshots

This commit is contained in:
2026-06-20 20:34:41 -05:00
parent ab2f0a6e6a
commit 779a6c4f41
5 changed files with 19 additions and 7 deletions
@@ -4,15 +4,17 @@
lib,
...
}: let
service = "holocron_offsite";
service = "offsite";
cfg = config.holocron.${service};
sec = config.sops.secrets;
in {
options.holocron.ensure_perms = {
options.holocron.offsite = {
enable = lib.mkEnableOption "enables backup script for holocron fileshare";
paths = lib.mkOption {
type = with lib.types; listOf str;
default = [
"/holocron/srv"
"/holocron/users"
];
description = "list of paths to backup";
};
@@ -39,12 +41,14 @@ in {
serviceConfig = {
Type = "oneshot";
User = "root";
Group = "archives";
};
script = ''
${pkgs.sshpass}/bin/sshpass -f ${sec."lifeboat_rsync".path} \
${pkgs.rsync}/bin/rsync -aHAX --partial --numeric-ids --info=progress2,name1,stats2 --delete \
-e "ssh -o StrictHostKeyChecking=no" \
-e "${pkgs.openssh}/bin/ssh -o StrictHostKeyChecking=no" \
${builtins.concatStringsSep " " cfg.paths} \
${cfg.offsite_user}@${cfg.offsite_target}::${cfg.offsite_dir}
'';