{ pkgs, config, ... }: let secrets = config.services.secrets.secrets; in { environment.systemPackages = with pkgs; [ restic (pkgs.writeShellScriptBin "restic-piped-finland" '' env \ RESTIC_PASSWORD_FILE=${secrets.restic_password.path} \ $(cat ${secrets.restic_env.path}) \ ${pkgs.restic}/bin/restic $@ '') ]; services.restic.backups.piped-finland = { user = "root"; paths = [ "/var/lib/cockroachdb" "/var/lib/cockroachdb-certs" ]; repository = "rest:https://storage-restic.owo.monster/Piped-Finland"; passwordFile = "${secrets.restic_password.path}"; environmentFile = "${secrets.restic_env.path}"; pruneOpts = [ "--keep-last 5" ]; timerConfig = { OnBootSec = "1m"; OnCalendar = "daily"; }; }; }