baseddata.io/shell.nix

29 lines
810 B
Nix
Raw Normal View History

2024-09-20 17:49:31 +01:00
{pkgs ? import <nixpkgs> {}}:
2024-08-01 14:06:16 +01:00
pkgs.mkShell
{
nativeBuildInputs = with pkgs; [
hugo
2024-11-07 21:39:26 +00:00
python311
poetry
2024-08-01 14:06:16 +01:00
];
2024-11-07 21:39:26 +00:00
NIX_LD_LIBRARY_PATH=/run/current-system/sw/share/nix-ld/lib;
NIX_LD=/run/current-system/sw/share/nix-ld/lib/ld.so;
2024-09-20 17:49:31 +01:00
shellHook = ''
2024-08-20 10:17:41 +01:00
${pkgs.cowsay}/bin/cowsay "Welcome to the baseddata.io development environment!" | ${pkgs.lolcat}/bin/lolcat
2024-11-07 21:39:26 +00:00
export LD_LIBRARY_PATH=$NIX_LD_LIBRARY_PATH
source .env
source .venv/bin/activate
2024-08-20 10:17:41 +01:00
get_session=$(tmux list-session | grep "baseddata")
if [ -z "$get_session" ];
then
tmux new-session -d -s baseddata
tmux split-window -h
tmux send-keys -t 0 "hugo server" C-m
2024-09-23 17:46:59 +01:00
tmux send-keys -t 1 "cd backend && uvicorn main:app --reload" C-m
2024-08-20 10:17:41 +01:00
echo "Baseddata running in dev tmux shell"
fi
2024-09-20 17:49:31 +01:00
'';
2024-08-01 14:06:16 +01:00
}