services: gitea: add state to backup

Because I think `restic` will not deal with the compressed format of
`gitea`'s native `dump` command, I set up a manual backup.

This could lead to potentially corrupted data if I happen to backup at
the exact same time as a push to a repository. However given the
frequency of backups planned, I assume that most of them will be fine.
This commit is contained in:
Bruno BELANYI 2021-02-07 20:43:15 +00:00
parent 2db7189f50
commit 5fc1b7ae74

View file

@ -38,6 +38,11 @@ in
type = "postgres"; # Automatic setup
user = "git"; # User needs to be the same as gitea user
};
# NixOS module uses `gitea dump` to backup repositories and the database,
# but it produces a single .zip file that's not very backup friendly.
# I configure my backup system manually below.
dump.enable = false;
};
users.users.git = {
@ -61,5 +66,12 @@ in
locations."/".proxyPass = "http://localhost:${toString cfg.port}/";
};
my.services.backup = {
paths = [
config.services.gitea.lfs.contentDir
config.services.gitea.repositoryRoot
];
};
};
}