From d478dbd916c240e5ff609dcca17eedbd04c7fe83 Mon Sep 17 00:00:00 2001 From: Martin Fischer Date: Fri, 13 Dec 2024 07:35:32 +0100 Subject: tente: add nginx --- nixos/parts/dev.nix | 2 ++ nixos/parts/scripts/deploy-dir | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100755 nixos/parts/scripts/deploy-dir (limited to 'nixos/parts') diff --git a/nixos/parts/dev.nix b/nixos/parts/dev.nix index aca8e78..0d258b4 100644 --- a/nixos/parts/dev.nix +++ b/nixos/parts/dev.nix @@ -19,6 +19,8 @@ sqlite-interactive tokei + (writeShellScriptBin "deploy-dir" (builtins.readFile ./scripts/deploy-dir)) + gcc # rustc fails if cc linker isn't found chromium diff --git a/nixos/parts/scripts/deploy-dir b/nixos/parts/scripts/deploy-dir new file mode 100755 index 0000000..bb7dfdf --- /dev/null +++ b/nixos/parts/scripts/deploy-dir @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +if [ "$#" -ne 3 ]; then + echo "usage: $0 " + exit 1 +fi +printf -v remote_dir %q $3 + +cd $1 +tar cf - . | ssh $2 "set -xe +TEMP_DIR=\$(mktemp -d) +cd \$TEMP_DIR +tar xvf - +rm -rf $remote_dir +mv \$TEMP_DIR $remote_dir +" -- cgit v1.2.3