nixpkgs/home/packages/custom/backup/default.nix
Daniel Siepmann 64ab6616fa
Remove unnecessary rsync reference from backup script
The script already adds rsync to the path, no need to use the more
complex approach within the string.
2022-08-09 12:01:33 +02:00

34 lines
607 B
Nix

{
writeShellApplication,
borgbackup,
git,
rsync
}:
writeShellApplication {
name = "custom-backup";
runtimeInputs = [
borgbackup
rsync
git
];
text = ''
borg create \
-v \
--progress \
--stats \
--exclude-from ~/.config/borg/exclude \
/media/daniels/Backup/borg::"$(date +%F-%R)" \
~/
rsync -az --delete ~/.config/nixpkgs /media/daniels/Backup/
sudo rsync -az /etc/.git /media/daniels/Backup/etc/
sudo chown daniels:daniels -R /media/daniels/Backup/etc/
cd /media/daniels/Backup/etc/
git reset --hard master
'';
}