nixfiles/hosts/hetzner-arm/containers/quassel/profiles/restic.nix

40 lines
915 B
Nix
Raw Normal View History

2023-08-01 20:53:25 +01:00
{
pkgs,
config,
2023-08-01 20:53:25 +01:00
...
}: let
secrets = config.services.secrets.secrets;
2023-08-01 20:53:25 +01:00
in {
environment.systemPackages = with pkgs; [
restic
(pkgs.writeShellScriptBin "restic-quassel" ''
env \
RESTIC_PASSWORD_FILE=${secrets.restic_password.path} \
$(cat ${secrets.restic_env.path}) \
2023-08-01 20:53:25 +01:00
${pkgs.restic}/bin/restic $@
'')
];
services.restic.backups.quassel = {
user = "root";
paths = [
"/home/quassel/.config/quassel-irc.org"
];
# repository is overrided in environmentFile to contain auth
# make sure to keep up to date when changing repository
repository = "rest:https://storage-restic.owo.monster/Quassel";
passwordFile = "${secrets.restic_password.path}";
environmentFile = "${secrets.restic_env.path}";
2023-08-01 20:53:25 +01:00
pruneOpts = [
"--keep-last 5"
];
timerConfig = {
OnBootSec = "1m";
OnCalendar = "daily";
};
};
}