forked from clan/clan-core
add deploy script for homepage
This commit is contained in:
parent
30663d563d
commit
c3f2c548a6
35
docs/deploy-docs.nix
Normal file
35
docs/deploy-docs.nix
Normal file
@ -0,0 +1,35 @@
|
||||
{
|
||||
writeShellScriptBin,
|
||||
coreutils,
|
||||
openssh,
|
||||
rsync,
|
||||
lib,
|
||||
docs,
|
||||
}:
|
||||
|
||||
writeShellScriptBin "deploy-docs" ''
|
||||
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
|
||||
''
|
@ -1,11 +1,17 @@
|
||||
{ inputs, ... }:
|
||||
{
|
||||
perSystem =
|
||||
{ self', pkgs, ... }:
|
||||
{
|
||||
config,
|
||||
self',
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
devShells.docs = pkgs.callPackage ./shell.nix { inherit (self'.packages) docs; };
|
||||
packages = {
|
||||
docs = pkgs.python3.pkgs.callPackage ./default.nix { inherit (inputs) nixpkgs; };
|
||||
deploy-docs = pkgs.callPackage ./deploy-docs.nix { inherit (config.packages) docs; };
|
||||
};
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user