gutterman: add restic backups to minecraft
This commit is contained in:
parent
49a5d29b0a
commit
91a0bb384a
6 changed files with 72 additions and 2 deletions
31
modules/nixos/services/gameserver/restic.nix
Normal file
31
modules/nixos/services/gameserver/restic.nix
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
sops.secrets = {
|
||||
"restic/password" = {};
|
||||
"restic/rest-auth.env" = {};
|
||||
};
|
||||
|
||||
services.restic.backups.gameservers =
|
||||
assert config.users.users.restic-backup != null;
|
||||
{
|
||||
user = "restic-backup";
|
||||
package = pkgs.writeShellScriptBin "restic" ''
|
||||
exec /run/wrappers/bin/restic "$@"
|
||||
'';
|
||||
|
||||
initialize = true;
|
||||
repository = "rest:https://restic.taild5f7e6.ts.net/gutterman/gameservers";
|
||||
environmentFile = config.sops.secrets."restic/rest-auth.env".path;
|
||||
passwordFile = config.sops.secrets."restic/password".path;
|
||||
timerConfig = {
|
||||
OnCalendar = "03:00";
|
||||
Persistent = true;
|
||||
};
|
||||
|
||||
paths = [
|
||||
"/var/lib/minecraft"
|
||||
];
|
||||
exclude = [ ".*" ];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue