Migrate borg backup to proper shell script installed via nix

This commit is contained in:
Daniel Siepmann 2022-05-24 17:33:16 +02:00
parent 57b00d7852
commit 14cc26c829
Signed by: Daniel Siepmann
GPG key ID: 33D6629915560EF4
5 changed files with 59 additions and 24 deletions

View file

@ -1,14 +1,25 @@
/home/daniels/.3T
/home/daniels/.audacity-data
/home/daniels/.cache
/home/daniels/.config
/home/daniels/.dbus
/home/daniels/.dvdcss
/home/daniels/.gvfs
/home/daniels/.icons
/home/daniels/.java
/home/daniels/.local
/home/daniels/.mozilla/firefox/jco1rw0p.default/storage/default
/home/daniels/.mozilla
/home/daniels/.nix-profile/
/home/daniels/.node
/home/daniels/.npm
/home/daniels/.rnd
/home/daniels/.vimundo
/home/daniels/Applications/
/home/daniels/Documents/Audacity/
/home/daniels/Documents/Mail/
/home/daniels/Downloads
/home/daniels/Music
/home/daniels/Projects
/home/daniels/Videos
/home/daniels/snap
/home/daniels/Downloads/
/home/daniels/Music/
/home/daniels/Pictures/
/home/daniels/Projects/
/home/daniels/Videos/
/home/daniels/snap/

View file

@ -74,9 +74,6 @@ in {
t3Pull = "git pull --rebase origin master; git checkout master";
t3Rollback = "git checkout master; git reset --hard origin/master";
t3Clean = "t3Rollback && t3Pull";
# TODO: Move to nix package / shellapplication Create borg backup
createBackup = "mkdir -p ~/backup-etc && sudo cp -r /etc/* ~/backup-etc && sudo cp -r /etc/.* ~/backup-etc && sudo chown daniels:daniels -R ~/backup-etc/ && borg create -v --progress --stats --exclude-from ~/.config/borg/exclude /media/daniels/Backup::$(date +%F-%R) ~/; sudo rm -rf ~/backup-etc";
};
}

View file

@ -11,6 +11,7 @@ with pkgs; [
dmenu-custom-scripts
custom-update-system
custom-push-etckeeper
custom-backup
dunst
i3blocks
st

View file

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

View file

@ -95,6 +95,23 @@ List of manual needed changes for various reasons.
Todos
-----
Migration:
* Custom scripts from overlay to packages which are called from home/packages.nix?
* Migrate PGP?
* Right now I've installed gnupg2, gnupg, gpg on ubuntu
* Thunderbird configuration to nix. Seems like no module exists, but is same as
for firefox.
* Migrate home manager to use flake for better rollback support if update breaks something.
* Maybe PR upstream: `./home/modules/programs/languagetool.nix`.
* i3lock-color
Additions:
* https://github.com/altdesktop/playerctl#selecting-the-most-recent-player in
@ -105,21 +122,6 @@ Additions:
* Integrate https://github.com/Wilfred/difftastic for diffing source code
https://github.com/nix-community/home-manager/pull/2850
Migration:
* Thunderbird configuration to nix. Seems like no module exists, but is same as
for firefox.
* Migrate PGP?
* Right now I've installed gnupg2, gnupg, gpg on ubuntu
* Migrate home manager to use flake for better rollback support if update breaks something.
* Maybe PR upstream: `./home/modules/programs/languagetool.nix`.
* i3lock-color
Ideas
-----