-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
67 lines (57 loc) · 2.18 KB
/
Copy pathflake.nix
File metadata and controls
67 lines (57 loc) · 2.18 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
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
{
description = "Esper: Hermetic Neuro-Symbolic Reasoning Engine Development Environment";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs = { self, nixpkgs }:
let
supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
in
{
devShells = forAllSystems (system:
let
pkgs = nixpkgsFor.${system};
in
{
default = pkgs.mkShell {
buildInputs = with pkgs; [
uv
curl
git
clang
zlib
ncurses
libxml2
];
shellHook = ''
export PROJECT_ROOT="$(pwd)"
export UV_PROJECT_ENVIRONMENT="$PROJECT_ROOT/.venv"
echo "Checking Esper environment..."
if [ ! -f "$PROJECT_ROOT/.venv/bin/mojo" ]; then
echo "Mojo not found in local environment. Bootstrapping via uv..."
# We do not use `uv init esper` here because we are already in the repository root.
# Initialize the virtual environment
uv venv
# Activate the environment
source .venv/bin/activate
# Install Mojo 1.0 beta from PyPI (prerelease).
uv pip install "mojo==1.0.0b2" --prerelease allow
# Make the fresh venv survive the repo being moved. `uv venv` and
# `uv pip install` bake absolute paths in (console-script shebangs
# and activate's VIRTUAL_ENV), and a later move turns activation
# into a silent no-op that falls through to the system python.
# See tools/venv_relocate.sh and the CLAUDE.md note.
"$PROJECT_ROOT/tools/venv_relocate.sh" || true
echo "Esper Hermetic Environment Initialized."
else
source .venv/bin/activate
echo "Esper Environment Loaded."
fi
'';
};
}
);
};
}