-
Notifications
You must be signed in to change notification settings - Fork 0
/
devenv.nix
38 lines (32 loc) · 969 Bytes
/
devenv.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
# devenv.nix
{ pkgs, ... }:
{
name = "Python project template";
# https://devenv.sh/packages/
packages = [
pkgs.python311
pkgs.python311Packages.pip-tools
pkgs.poetry
];
# Set any environment variables here.
# https://devenv.sh/reference/options/#env
# env.TEST_ENV_VAR_1="foo";
# env.TEST_ENV_VAR_2="bar";
# Secrets can be set in a .env file. Change to true if needed.
# https://devenv.sh/reference/options/#dotenvenable
dotenv.enable = false;
# Create a Python virtual environment if it doesn't exist, activate it, and install or
# uninstall Python packages according to requirements.txt.
# https://devenv.sh/reference/options/#entershell
enterShell = ''
if [[ ! -d .venv ]]
then
python -m venv .venv
source .venv/bin/activate
pip install --upgrade pip wheel setuptools
fi
source .venv/bin/activate
make sync
'';
# See full reference at https://devenv.sh/reference/options/
}