From 4369f3cdcee2adda28cb882fdfe78398b4209a23 Mon Sep 17 00:00:00 2001 From: Qiming Chu Date: Sun, 9 Mar 2025 17:23:51 +0800 Subject: [PATCH] config(programs): add restic scripts for backup Signed-off-by: Qiming Chu --- modules/programs/restic.nix | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 modules/programs/restic.nix diff --git a/modules/programs/restic.nix b/modules/programs/restic.nix new file mode 100644 index 0000000..9269003 --- /dev/null +++ b/modules/programs/restic.nix @@ -0,0 +1,22 @@ +{ pkgs, lib, ... }: { + home.packages = [ pkgs.restic ]; + + home.file.".config/restic/restic-env".text = '' + export B2_ACCOUNT_ID= + export B2_ACCOUNT_KEY= + export RESTIC_REPOSITORY=b2:: + export RESTIC_PASSWORD_FILE=~/.config/restic/restic-password + ''; + home.file.".config/restic/restic-password".text = '' + YOUR_PASSWORD + ''; + home.file.".config/restic/backup.sh".text = '' + #!/bin/env bash + restic backup --exclude-caches \ + --exclude .Trash --exclude .DS_Store --exclude .localized \ + --exclude .Spotlight-V100 --exclude .fseventsd \ + --exclude .DocumentRevisions-V100 --exclude .MobileBackups \ + --exclude .VolumeIcon.icns --exclude .PKInstallSandboxManager \ + ~/Documents ~/Desktop ~/Downloads ~/Pictures ~/Movies + ''; +}