-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshell.nix
44 lines (35 loc) · 1012 Bytes
/
shell.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
{
nixpkgs ? fetchTarball "https://github.com/NixOS/nixpkgs/tarball/nixos-24.05",
pkgs ? import nixpkgs { config = {}; overlays = []; }
}:
pkgs.mkShellNoCC {
packages = with pkgs; [
cowsay
bun
nodePackages.typescript
nodePackages.typescript-language-server
nodePackages.prettier
emmet-ls
nodePackages.pyright
python3
python3Packages.pip
python3Packages.virtualenv
];
# Hook to install requirements when entering the shell
shellHook = ''
# Create a Python virtual environment if it doesn't exist
if [ ! -d ".venv" ]; then
echo "Creating Python virtual environment..."
python3 -m venv .venv
fi
source .venv/bin/activate
if [ -f "requirements.txt" ]; then
echo "Installing Python requirements..."
pip install -r requirements.txt
else
echo "No requirements.txt found. Skipping dependency installation."
fi
echo "Development environment is ready!"
cowsay "Nix Shell Activated!"
'';
}