-
Notifications
You must be signed in to change notification settings - Fork 9
/
shell.nix
93 lines (77 loc) · 2.02 KB
/
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
{ pkgs ? import <nixpkgs> {} }:
let
# Python packages needed for AI/ML development
pythonPackages = ps: with ps; [
# Core ML/AI packages
anthropic
boto3
pydantic
openai
# Development tools
pytest
black
flake8
];
# Define Python environment
python = pkgs.python311.withPackages pythonPackages;
# Core development tools
commonTools = with pkgs; [
# Python environment
python
poetry
# Core shell tools
bash-completion
direnv
fzf
jq
# Version control
git
# Build tools
gnumake
# Editor
emacs29
# AWS tools
awscli2
localstack
# Clojure development
clojure
leiningen
clojure-lsp
babashka
];
# Darwin-specific packages
darwinPackages = with pkgs.darwin; [
apple_sdk.frameworks.Security
apple_sdk.frameworks.CoreServices
apple_sdk.frameworks.CoreFoundation
apple_sdk.frameworks.Foundation
];
in
pkgs.mkShell {
buildInputs = commonTools ++ (if pkgs.stdenv.isDarwin then darwinPackages else []);
shellHook = ''
# Source bash completion for better CLI experience
source ${pkgs.bash-completion}/etc/profile.d/bash-completion.sh
if [ -f ${pkgs.git}/share/git/contrib/completion/git-completion.bash ]; then
source ${pkgs.git}/share/git/contrib/completion/git-completion.bash
fi
# Set up environment paths
export PATH="$PWD/scripts:$PATH"
export PYTHONPATH="$PWD/src:$PYTHONPATH"
# Darwin-specific configurations
if [ "$(uname)" = "Darwin" ]; then
export NIX_LDFLAGS="-F${pkgs.darwin.apple_sdk.frameworks.CoreFoundation}/Library/Frameworks -framework CoreFoundation $NIX_LDFLAGS"
fi
# Project environment info
echo "AIF-C01 development environment loaded."
if command -v python >/dev/null; then
echo "Python: $(python --version)"
fi
if command -v clojure >/dev/null; then
echo "Clojure: $(clojure --version)"
fi
if command -v emacs >/dev/null; then
echo "Emacs: $(emacs --version | head -n1)"
fi
'';
}