Commit 7bf1b4d0 authored by Luca A.'s avatar Luca A.
Browse files

nixos/forgejo: add age setting to automatic dump

Currently dump are added to the directory but not cleaned up.
This setting allows the user to customize the cleanup age of dumps.
parent 3300e505
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -121,6 +121,8 @@

- Zig 0.12 has been removed.

- `services.forgejo.dump.age` now defaults to `4w`, which deletes dumps older than 4 weeks. This new behaviour could result in older backups being deleted.

- `ansible-later` has been removed because it was discontinued by the author.

- `k3s` airgap images passthru attributes have changed:
+14 −1
Original line number Diff line number Diff line
@@ -285,6 +285,19 @@ in
          description = "Filename to be used for the dump. If `null` a default name is chosen by forgejo.";
          example = "forgejo-dump";
        };

        age = mkOption {
          type = types.str;
          default = "4w";
          example = "5d";
          description = ''
            Age of backup used to decide what files to delete when cleaning.
            If a file or directory is older than the current time minus the age field, it is deleted.

            The format is described in
            {manpage}`tmpfiles.d(5)`.
          '';
        };
      };

      lfs = {
@@ -596,7 +609,7 @@ in
    };

    systemd.tmpfiles.rules = [
      "d '${cfg.dump.backupDir}' 0750 ${cfg.user} ${cfg.group} - -"
      "d '${cfg.dump.backupDir}' 0750 ${cfg.user} ${cfg.group} ${cfg.dump.age} -"
      "z '${cfg.dump.backupDir}' 0750 ${cfg.user} ${cfg.group} - -"
      "d '${cfg.repositoryRoot}' 0750 ${cfg.user} ${cfg.group} - -"
      "z '${cfg.repositoryRoot}' 0750 ${cfg.user} ${cfg.group} - -"