docs: clean up directory structure

This commit is contained in:
Johannes Kirschbauer
2024-04-13 14:42:37 +02:00
parent 4b152ddd5e
commit 77921f9c79
23 changed files with 10 additions and 12 deletions

36
docs/nix/deploy-docs.nix Normal file
View File

@@ -0,0 +1,36 @@
{
writeShellScriptBin,
coreutils,
openssh,
rsync,
lib,
docs,
}:
writeShellScriptBin "deploy-docs" ''
set -eux -o pipefail
export PATH="${
lib.makeBinPath [
coreutils
openssh
rsync
]
}"
if [ -n "$SSH_HOMEPAGE_KEY" ]; then
echo "$SSH_HOMEPAGE_KEY" > ./ssh_key
chmod 600 ./ssh_key
sshExtraArgs="-i ./ssh_key"
else
sshExtraArgs=
fi
rsync \
-e "ssh -o StrictHostKeyChecking=no $sshExtraArgs" \
-a ${docs}/ \
www@clan.lol:/var/www/docs.clan.lol
if [ -e ./ssh_key ]; then
rm ./ssh_key
fi
''