From 5c0a486388e1aeb9084e189f1a7352d2b7ac8347 Mon Sep 17 00:00:00 2001 From: Ingolf Wagner Date: Wed, 3 May 2023 16:09:27 +0200 Subject: [PATCH] add new zfs resources --- nixos/machines/chungus/disko-config.nix | 50 ++++++++++++++++++++----- nixos/machines/chungus/rbackup.nix | 7 +++- 2 files changed, 46 insertions(+), 11 deletions(-) diff --git a/nixos/machines/chungus/disko-config.nix b/nixos/machines/chungus/disko-config.nix index e91598f..a2a4517 100644 --- a/nixos/machines/chungus/disko-config.nix +++ b/nixos/machines/chungus/disko-config.nix @@ -115,8 +115,9 @@ in options = { mountpoint = "legacy"; compression = "lz4"; - "com.sun:auto-snapshot" = "false"; - "com.sun:auto-snapshot:daily" = "true,keep=32"; + "com.sun:auto-snapshot:daily" = true; + "com.sun:auto-snapshot:weekly" = true; + "com.sun:auto-snapshot:montly" = true; }; }; "nextcloud" = { @@ -125,9 +126,10 @@ in options = { mountpoint = "legacy"; compression = "lz4"; - "com.sun:auto-snapshot" = "false"; - "com.sun:auto-snapshot:daily" = "true,keep=32"; - "com.sun:auto-snapshot:montly" = "true,keep=48"; + "com.sun:auto-snapshot:hourly" = true; + "com.sun:auto-snapshot:daily" = true; + "com.sun:auto-snapshot:weekly" = true; + "com.sun:auto-snapshot:montly" = true; }; }; "legacy" = { @@ -136,6 +138,7 @@ in options = { mountpoint = "legacy"; compression = "lz4"; + "com.sun:auto-snapshot:montly" = true; }; }; "borg" = { @@ -144,8 +147,9 @@ in options = { mountpoint = "legacy"; compression = "lz4"; - "com.sun:auto-snapshot" = "false"; - "com.sun:auto-snapshot:daily" = "true,keep=32"; + "com.sun:auto-snapshot:daily" = true; + "com.sun:auto-snapshot:weekly" = true; + "com.sun:auto-snapshot:montly" = true; }; }; "services" = { @@ -154,9 +158,9 @@ in options = { mountpoint = "legacy"; compression = "lz4"; - "com.sun:auto-snapshot" = "false"; - "com.sun:auto-snapshot:daily" = "true,keep=32"; - "com.sun:auto-snapshot:montly" = "true,keep=48"; + "com.sun:auto-snapshot:daily" = true; + "com.sun:auto-snapshot:weekly" = true; + "com.sun:auto-snapshot:montly" = true; }; }; "services/gitea" = { @@ -167,6 +171,32 @@ in compression = "lz4"; }; }; + "robi" = { + type = "zfs_fs"; + mountpoint = "/robi"; + options = { + mountpoint = "legacy"; + compression = "lz4"; + "com.sun:auto-snapshot:daily" = true; + "com.sun:auto-snapshot:weekly" = true; + }; + }; + "robi/media" = { + type = "zfs_fs"; + mountpoint = "/robi/media"; + options = { + mountpoint = "legacy"; + compression = "lz4"; + }; + }; + "robi/torrent" = { + type = "zfs_fs"; + mountpoint = "/robi/torrent"; + options = { + mountpoint = "legacy"; + compression = "lz4"; + }; + }; }; }; diff --git a/nixos/machines/chungus/rbackup.nix b/nixos/machines/chungus/rbackup.nix index 3d5788e..113aa95 100644 --- a/nixos/machines/chungus/rbackup.nix +++ b/nixos/machines/chungus/rbackup.nix @@ -26,7 +26,12 @@ media = { sshKeyPath = config.sops.secrets.rsync_private_key.path; src = "root@robi:/media/syncthing/media/"; - dst = "/media"; + dst = "/robi/media"; + }; + torrent = { + sshKeyPath = config.sops.secrets.rsync_private_key.path; + src = "root@robi:/media/torrent/downloads/"; + dst = "/robi/torrent"; }; };