aboutsummaryrefslogtreecommitdiff
path: root/nix/machines/vm-synology/backups.nix
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2025-07-21 07:31:45 -0700
committerFranck Cuny <franck@fcuny.net>2025-07-21 08:13:11 -0700
commit23f8df7396d35744069a4bda0d1d38a55ff64b79 (patch)
tree772b5e72355e9ee5b3ae31aef37fe1d4508e8f30 /nix/machines/vm-synology/backups.nix
parentadd docker helpers and clean up some dependencies (diff)
downloadinfra-23f8df7396d35744069a4bda0d1d38a55ff64b79.tar.gz
refactoring to use flake-parts and automatic imports of hosts
This is the first step in a large refactoring to use flake-parts, and to automatically imports hosts based on paths.
Diffstat (limited to 'nix/machines/vm-synology/backups.nix')
-rw-r--r--nix/machines/vm-synology/backups.nix73
1 files changed, 0 insertions, 73 deletions
diff --git a/nix/machines/vm-synology/backups.nix b/nix/machines/vm-synology/backups.nix
deleted file mode 100644
index cf3c65b..0000000
--- a/nix/machines/vm-synology/backups.nix
+++ /dev/null
@@ -1,73 +0,0 @@
-{
- config,
- pkgs,
- ...
-}:
-let
- environmentFile = toString (
- pkgs.writeText "restic-gcs-env" ''
- GOOGLE_PROJECT_ID=fcuny-infra
- GOOGLE_APPLICATION_CREDENTIALS=${config.age.secrets.restic_gcs_credentials.path}
- ''
- );
-in
-{
- services.restic.backups.local = {
- passwordFile = config.age.secrets.restic_password.path;
- repository = "/srv/data/backups/";
- initialize = true;
- paths = [ "/var/lib/gitolite" ];
- exclude = [
- "/var/lib/gitolite/.bash_history"
- "/var/lib/gitolite/.ssh"
- "/var/lib/gitolite/.viminfo"
- ];
- extraBackupArgs = [
- "--exclude-caches"
- "--compression=max"
- ];
- timerConfig = {
- OnCalendar = "daily";
- };
- pruneOpts = [
- "--keep-daily 7"
- "--keep-weekly 4"
- "--keep-monthly 3"
- ];
- };
-
- services.restic.backups.gcs = {
- passwordFile = config.age.secrets.restic_password.path;
- environmentFile = environmentFile;
- repository = "gs:fcuny-infra-backups:/vm-synology/";
- initialize = true;
- paths = [ "/var/lib/gitolite" ];
- exclude = [
- "/var/lib/gitolite/.bash_history"
- "/var/lib/gitolite/.ssh"
- "/var/lib/gitolite/.viminfo"
- ];
- extraBackupArgs = [
- "--exclude-caches"
- "--compression=max"
- ];
- timerConfig = {
- OnCalendar = "daily";
- };
- pruneOpts = [
- "--keep-daily 7"
- "--keep-weekly 4"
- "--keep-monthly 3"
- ];
- };
-
- environment = {
- sessionVariables = {
- RESTIC_REPOSITORY = "/srv/data/backups";
- RESTIC_PASSWORD_FILE = config.age.secrets.restic_password.path;
- };
- systemPackages = with pkgs; [
- restic
- ];
- };
-}