From 922012c21537eddc5bca2d4f3bdaf2a90a2b0076 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Thu, 16 Jan 2025 08:07:06 +0000 Subject: [PATCH] Add upload-to-files script --- nix/pkgs/default.nix | 1 + nix/pkgs/upload-to-files.nix | 9 +++++++++ nix/users/opdavies/default.nix | 4 +++- 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 nix/pkgs/upload-to-files.nix diff --git a/nix/pkgs/default.nix b/nix/pkgs/default.nix index a91c709..a5fe44c 100644 --- a/nix/pkgs/default.nix +++ b/nix/pkgs/default.nix @@ -10,6 +10,7 @@ in notes = callPackage ./notes.nix { }; i3-battery-popup = callPackage ./i3-battery-popup.nix { }; tmux-sessionizer = callPackage ./tmux-sessionizer.nix { }; + upload-to-files = callPackage ./upload-to-files.nix { }; vimPlugins = prev.vimPlugins // vimPlugins; } diff --git a/nix/pkgs/upload-to-files.nix b/nix/pkgs/upload-to-files.nix new file mode 100644 index 0000000..da0641b --- /dev/null +++ b/nix/pkgs/upload-to-files.nix @@ -0,0 +1,9 @@ +{ pkgs }: + +pkgs.writeShellApplication { + name = "upload-to-files"; + + text = '' + ${pkgs.rsync}/bin/rsync -avz --info=progress2 "$1" ssh.oliverdavies.uk:/var/www/vhosts/files.oliverdavies.uk + ''; +} diff --git a/nix/users/opdavies/default.nix b/nix/users/opdavies/default.nix index 0d15bcd..117f9af 100644 --- a/nix/users/opdavies/default.nix +++ b/nix/users/opdavies/default.nix @@ -23,7 +23,9 @@ packages = with pkgs; - [ ] + [ + upload-to-files + ] ++ pkgs.lib.optionals (!headless) [ brave firefox