X-Git-Url: https://git.immae.eu/?p=perso%2FImmae%2FConfig%2FNix.git;a=blobdiff_plain;f=modules%2Frsync_backup%2Fdefault.nix;h=a2ef0fdcf333940ab815769ef7191acac852f83f;hp=dadf5e7cd6ed8375f96816f183df0d9f7680fbcc;hb=739d28eaf8cb226f74a7e7f5ad31fb152a90ee4b;hpb=71a2425ed95120a6de3a41bb233b1066779d4c26 diff --git a/modules/rsync_backup/default.nix b/modules/rsync_backup/default.nix index dadf5e7..a2ef0fd 100644 --- a/modules/rsync_backup/default.nix +++ b/modules/rsync_backup/default.nix @@ -84,19 +84,16 @@ let ssh_key = config.secrets.fullPaths."rsync_backup/identity"; - backup_head = mailto: '' + backup_head = '' #!${pkgs.stdenv.shell} EXCL_FROM=`mktemp` FILES_FROM=`mktemp` TMP_STDERR=`mktemp` on_exit() { - ${lib.optionalString (mailto != null) '' - MAILTO="${mailto}" if [ -s "$TMP_STDERR" ]; then - cat "$TMP_STDERR" | ${pkgs.mailutils}/bin/mail -s "save_distant rsync error" "$MAILTO" + cat "$TMP_STDERR" fi - ''} rm -f $TMP_STDERR $EXCL_FROM $FILES_FROM } @@ -186,11 +183,6 @@ in type = lib.types.path; description = "Path to the base folder for backups"; }; - mailto = lib.mkOption { - type = lib.types.nullOr lib.types.str; - default = null; - description = "E-mail to send the report to"; - }; profiles = lib.mkOption { type = lib.types.attrsOf profileModule; default = {}; @@ -223,7 +215,7 @@ in services.cron.systemCronJobs = let backup = pkgs.writeScript "backup.sh" (builtins.concatStringsSep "\n" ([ - (backup_head cfg.mailto) + backup_head ] ++ lib.mapAttrsToList backup_profile cfg.profiles)); in [ ''