add deploy script for homepage
This commit is contained in:
committed by
Johannes Kirschbauer
parent
caaaa10580
commit
e9b23af604
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, ... }:
|
{ inputs, ... }:
|
||||||
{
|
{
|
||||||
perSystem =
|
perSystem =
|
||||||
{ self', pkgs, ... }:
|
{
|
||||||
|
config,
|
||||||
|
self',
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
{
|
{
|
||||||
devShells.docs = pkgs.callPackage ./shell.nix { inherit (self'.packages) docs; };
|
devShells.docs = pkgs.callPackage ./shell.nix { inherit (self'.packages) docs; };
|
||||||
packages = {
|
packages = {
|
||||||
docs = pkgs.python3.pkgs.callPackage ./default.nix { inherit (inputs) nixpkgs; };
|
docs = pkgs.python3.pkgs.callPackage ./default.nix { inherit (inputs) nixpkgs; };
|
||||||
|
deploy-docs = pkgs.callPackage ./deploy-docs.nix { inherit (config.packages) docs; };
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user