Small adjustments

This commit is contained in:
Yan Lin 2025-05-16 22:20:19 +02:00
parent 01a9b1ac4d
commit 53c60f9add
11 changed files with 77 additions and 26 deletions

View file

@ -1,4 +1,4 @@
{ pkgs ? import <nixpkgs> {}, isDev ? true, restartRemote ? false, remoteHost ? "hetzner" }:
{ pkgs ? import <nixpkgs> {}, isDev ? true, restartRemote ? false }:
pkgs.mkShell {
packages = with pkgs; [
@ -9,6 +9,7 @@ pkgs.mkShell {
shellHook = let
venvPath = "$HOME/venv/homepage";
remoteHost = "hetzner";
in ''
export PIP_REQUIRE_VIRTUALENV=1
export VENV_PATH=${venvPath}
@ -18,20 +19,21 @@ pkgs.mkShell {
fi
source $VENV_PATH/bin/activate
pip install -r requirements.txt
python parser/md.py
python generate.py
${if isDev then ''
pip install watchdog
python watch.py
pip install watchdog==6.0.0
python watch.py && exit
'' else ''
python parser/md.py
python generate.py
rsync -avP --delete ./dist/ ${remoteHost}:/root/homepage/dist
rsync -avP ./docker-compose.yml ${remoteHost}:/root/homepage/
${if restartRemote then ''
ssh ${remoteHost} "cd /root/homepage && docker compose down && docker compose up -d"
'' else ""}
exit
''}
'';
}