From bb546c35c63838fab992feebac2adf18f6c3af8e Mon Sep 17 00:00:00 2001 From: Rouven Seifert Date: Mon, 24 Apr 2023 20:38:47 +0200 Subject: [PATCH] run nuc backups every 6 hours --- flake.lock | 12 +++++----- hosts/nuc/modules/backup/default.nix | 34 ++++++++++++++++------------ shared/zsh.nix | 4 ++++ 3 files changed, 29 insertions(+), 21 deletions(-) diff --git a/flake.lock b/flake.lock index eb0eb6b..8e7c365 100644 --- a/flake.lock +++ b/flake.lock @@ -38,11 +38,11 @@ ] }, "locked": { - "lastModified": 1682333170, - "narHash": "sha256-yrJIk5/ONaX0QVQoq67DzNPW7epOuiwAM9FY9xFrE8k=", + "lastModified": 1682347289, + "narHash": "sha256-BQHY4lzS3Tkx4XLmZPR5FSjKWMP+cKNtUM8pTC4L9Ek=", "owner": "nix-community", "repo": "home-manager", - "rev": "6f9781b1b0cf3fedbe9d2d0a785aeec4d6085c10", + "rev": "0263da497eae3246ea15ed6f0f7875bc15592cef", "type": "github" }, "original": { @@ -391,11 +391,11 @@ "nixpkgs": "nixpkgs_3" }, "locked": { - "lastModified": 1682275062, - "narHash": "sha256-+Z0szchvOKkiNoBU6HO9N9xORj9AlEUccPe3Bsn1Mvo=", + "lastModified": 1682345099, + "narHash": "sha256-UmVuGvrOrL2iSZOf3sqzJAtbI9Y1BVAOHOdCBCI6W10=", "owner": "hyprwm", "repo": "xdg-desktop-portal-hyprland", - "rev": "7d3da7e9686df82bb595857e1fde0cf235ad5fba", + "rev": "f9f08c802e96ede147f25f724977a156324a4cf4", "type": "github" }, "original": { diff --git a/hosts/nuc/modules/backup/default.nix b/hosts/nuc/modules/backup/default.nix index 9d1076c..d095d88 100644 --- a/hosts/nuc/modules/backup/default.nix +++ b/hosts/nuc/modules/backup/default.nix @@ -15,24 +15,28 @@ }; services.btrbk = { - instances."nuc-to-disk".settings = { - snapshot_preserve = "14d"; - snapshot_preserve_min = "2d"; - target_preserve = "30d 4w 12m"; - target_preserve_min = "2d"; - volume = { - "/mnt/pool" = { - subvolume = { - log = { - snapshot_create = "always"; - }; - lib = { - snapshot_create = "always"; + instances."nuc-to-disk" = + { + settings = { + snapshot_preserve = "14d"; + snapshot_preserve_min = "2d"; + target_preserve = "30d 4w 12m"; + target_preserve_min = "2d"; + volume = { + "/mnt/pool" = { + subvolume = { + log = { + snapshot_create = "always"; + }; + lib = { + snapshot_create = "always"; + }; + }; + target = "/mnt/backup/nuc"; }; }; - target = "/mnt/backup/nuc"; }; + onCalendar = "*-*-* */6:00:00"; }; - }; }; } diff --git a/shared/zsh.nix b/shared/zsh.nix index 11b4a32..8ff64de 100644 --- a/shared/zsh.nix +++ b/shared/zsh.nix @@ -49,6 +49,10 @@ prompt_dir() { prompt_segment blue $CURRENT_FG '%c' } + + witch() { + readlink -f $(which $1) + } cat ${../images/cat.sixel} '';