Skip to content

Commit

Permalink
config(programs): add restic scripts for backup
Browse files Browse the repository at this point in the history
Signed-off-by: Qiming Chu <[email protected]>
  • Loading branch information
Emin017 committed Mar 9, 2025
1 parent 957c88d commit 4369f3c
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions modules/programs/restic.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{ pkgs, lib, ... }: {
home.packages = [ pkgs.restic ];

home.file.".config/restic/restic-env".text = ''
export B2_ACCOUNT_ID=<YOUR_ACCOUNT_ID>
export B2_ACCOUNT_KEY=<YOUR_ACCOUNT_KEY>
export RESTIC_REPOSITORY=b2:<YOUR_BUCKET_NAME>:<YOUR_BUCKET_PATH>
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
'';
}

0 comments on commit 4369f3c

Please sign in to comment.