]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - modules/rsync_backup/default.nix
Remove some handled fixme comments
[perso/Immae/Config/Nix.git] / modules / rsync_backup / default.nix
index a2ef0fdcf333940ab815769ef7191acac852f83f..f0df5a142d53bed4bb7f40fb5d8c21af53d8771b 100644 (file)
@@ -41,6 +41,13 @@ let
           Number of backups to keep
           '';
       };
+      check_command = lib.mkOption {
+        type = lib.types.str;
+        default = "backup";
+        description = ''
+          command to check if backup needs to be done
+        '';
+      };
       login = lib.mkOption {
         type = lib.types.str;
         description = ''
@@ -128,7 +135,7 @@ let
           -o CheckHostIP=no \
           -p $PORT \
           -i ${ssh_key} \
-          $DEST backup; then
+          $DEST ${profile.check_command}; then
         echo "Fichier de verrouillage backup sur $DEST ou impossible de se connecter" >&2
         skip=$DEST
       fi
@@ -168,7 +175,7 @@ let
       EOF
 
       OUT=$RSYNC_OUTPUT/$LOCAL
-      ${pkgs.rsync}/bin/rsync -XAavbrz --fake-super -e "ssh -o UserKnownHostsFile=/dev/null -o CheckHostIP=no -i ${ssh_key} -p $PORT" --numeric-ids --delete \
+      ${pkgs.rsync}/bin/rsync --new-compress -XAavbr --fake-super -e "ssh -o UserKnownHostsFile=/dev/null -o CheckHostIP=no -i ${ssh_key} -p $PORT" --numeric-ids --delete \
         --backup-dir=$BAK_BASE/$LOCAL \${
         lib.optionalString (part.args != null) "\n  ${part.args} \\"}${
         lib.optionalString (builtins.length part.exclude_from > 0) "\n  --exclude-from=$EXCL_FROM \\"}${
@@ -201,7 +208,6 @@ in
   };
 
   config = lib.mkIf (builtins.length (builtins.attrNames cfg.profiles) > 0) {
-    # FIXME: monitoring to check that backup is less than 14h old
     users.users.backup = {
       isSystemUser = true;
       uid = config.ids.uids.backup;