diff --git a/nix/home/opdavies/hosts/t480.nix b/nix/home/opdavies/hosts/t480.nix index 61a19f9c..8b43909d 100644 --- a/nix/home/opdavies/hosts/t480.nix +++ b/nix/home/opdavies/hosts/t480.nix @@ -28,6 +28,7 @@ }; home.packages = with pkgs; [ + backup-websites displayselect isync upload-to-files diff --git a/nix/pkgs/backup-websites.nix b/nix/pkgs/backup-websites.nix new file mode 100644 index 00000000..5ca8cb7f --- /dev/null +++ b/nix/pkgs/backup-websites.nix @@ -0,0 +1,13 @@ +{ lib, pkgs, ... }: + +pkgs.writeShellApplication { + name = "backup-websites"; + + text = '' + backup_path="''${HOME}/server-backup" + + mkdir -p "''${backup_path}" + + ${lib.getExe pkgs.rsync} -avzP ssh.oliverdavies.uk:/var/www/vhosts/ "''${backup_path}" --delete-after + ''; +} diff --git a/nix/pkgs/default.nix b/nix/pkgs/default.nix index 5723b5b1..4c5ab423 100644 --- a/nix/pkgs/default.nix +++ b/nix/pkgs/default.nix @@ -6,6 +6,7 @@ let vimPlugins = callPackage ./vim-plugins { inherit callPackage; }; in { + backup-websites = callPackage ./backup-websites.nix { }; build-glove80 = callPackage ./build-glove80.nix { }; displayselect = callPackage ./displayselect { }; notes = callPackage ./notes { };