aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2020-10-03 11:26:59 -0300
committerEuAndreh <eu@euandre.org>2020-10-03 11:26:59 -0300
commitc9feec71238d84a60a25bab8236d58b9d11dbb9e (patch)
tree0d03aab36f4f9e47dffb1ade8d55b54725eb8876
parentconfiguration.nix: Add symbola font (diff)
downloaddotfiles-c9feec71238d84a60a25bab8236d58b9d11dbb9e.tar.gz
dotfiles-c9feec71238d84a60a25bab8236d58b9d11dbb9e.tar.xz
fake-symlinks.sh: Add remotePublishScript attribute to utils.nix
-rw-r--r--bash/templates/utils.nix11
1 files changed, 11 insertions, 0 deletions
diff --git a/bash/templates/utils.nix b/bash/templates/utils.nix
index 65843a76..05fc884c 100644
--- a/bash/templates/utils.nix
+++ b/bash/templates/utils.nix
@@ -43,6 +43,17 @@
cp -R ${DOLLAR}{site} ${DOLLAR}OUT_PATH
chmod -R +w ${DOLLAR}OUT_PATH # make the new one writable too
'';
+ remotePublishScript = pkgs.writeShellScriptBin "publish.sh" ''
+ set -euo pipefail
+ SERVER_URL='euandreh.xyz'
+ REMOTE_PATH=/data/static/$PROJECT/
+ ${DOLLAR}{pkgs.openssh}/bin/ssh -o StrictHostKeyChecking=no "${DOLLAR}SERVER_URL" chmod -R +w "${DOLLAR}REMOTE_PATH"
+ ${DOLLAR}{pkgs.openssh}/bin/ssh -o StrictHostKeyChecking=no "${DOLLAR}SERVER_URL" rm -rf "${DOLLAR}REMOTE_PATH/*"
+ ${DOLLAR}{pkgs.rsync}/bin/rsync -avzP \
+ --rsh="ssh -o StrictHostKeyChecking=no" \
+ "${DOLLAR}{site}/" \
+ "${DOLLAR}SERVER_URL:${DOLLAR}REMOTE_PATH"
+ '';
shell = pkgs.mkShell {
name = "$PROJECT-development-environment-shell";
buildInputs = projectBuildInputs;