gutterman: add restic backups to minecraft

This commit is contained in:
wo2wz 2025-11-22 23:40:47 -05:00
parent 49a5d29b0a
commit 91a0bb384a
6 changed files with 72 additions and 2 deletions

View file

@ -0,0 +1,9 @@
{ config, ... }:
{
imports = [
./minecraft-server.nix
./restic.nix
./sops.nix
];
}

View 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 = [ ".*" ];
};
}

View file

@ -0,0 +1,5 @@
{ config, ... }:
{
sops.defaultSopsFile = "/etc/nixos/secrets/gutterman.yaml";
}