Migrate borg backup to proper shell script installed via nix
This commit is contained in:
parent
57b00d7852
commit
14cc26c829
|
@ -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/
|
||||
|
|
|
@ -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";
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ with pkgs; [
|
|||
dmenu-custom-scripts
|
||||
custom-update-system
|
||||
custom-push-etckeeper
|
||||
custom-backup
|
||||
dunst
|
||||
i3blocks
|
||||
st
|
||||
|
|
24
overlays/custom-backup/default.nix
Normal file
24
overlays/custom-backup/default.nix
Normal 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
|
||||
'';
|
||||
};
|
||||
}
|
32
readme.md
32
readme.md
|
@ -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
|
||||
-----
|
||||
|
||||
|
|
Loading…
Reference in a new issue