-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshell.nix
More file actions
41 lines (39 loc) · 1.02 KB
/
shell.nix
File metadata and controls
41 lines (39 loc) · 1.02 KB
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
with import <nixpkgs> { };
stdenv.mkDerivation {
name = "node";
buildInputs = [
nodejs-18_x
awscli2
# Used for lambda type completion:
python3
python3Packages.pip
];
shellHook = ''
export PYTHONPATH=${pkgs.python3.sitePackages}:$PYTHONPATH
python3 -m venv .venv
source .venv/bin/activate
pip install boto3 boto3-stubs[essential] black
source_lambda_env() {
while IFS= read -r line; do
# Skip empty lines and lines starting with #
if [[ ! -z "$line" && ! "$line" =~ ^# ]]; then
export "$line"
fi
done < .env.lambda
}
lambda_instances() {
# Execute in a subshell to avoid polluting the environment
(
source_lambda_env
python terraform/geomatch_app/sftp/lambda_source/instances.py
)
}
lambda_access() {
# Execute in a subshell to avoid polluting the environment
(
source_lambda_env
python terraform/geomatch_app/sftp/lambda_source/access.py
)
}
'';
}