Skip to content

Commit 33e12e6

Browse files
committed
Fix shell.nix for macOS compatibility and update to NixOS 24.11
- Update from NixOS 25.05 (non-existent) to stable NixOS 24.11 - Fix macOS build failure by properly handling Darwin frameworks without using deprecated darwin.apple_sdk - Add Security, CoreFoundation, and SystemConfiguration frameworks for macOS compatibility - Simplify Python environment setup for prysk testing, pin to specific version - Remove virtual environment in favor of user-space pip installation This resolves the "darwin.apple_sdk_11_0 has been removed" error on macOS while maintaining all testing capabilities with prysk. Fixes #1429
1 parent 72bdad5 commit 33e12e6

File tree

1 file changed

+50
-41
lines changed

1 file changed

+50
-41
lines changed

shell.nix

Lines changed: 50 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,58 @@
11
let
22
pkgs = import (fetchTarball {
3-
name = "nixos-25.05";
4-
url = "https://github.com/NixOS/nixpkgs/archive/refs/tags/25.05.tar.gz";
5-
sha256 = "1915r28xc4znrh2vf4rrjnxldw2imysz819gzhk9qlrkqanmfsxd";
3+
name = "nixos-24.11";
4+
url = "https://github.com/NixOS/nixpkgs/archive/refs/tags/24.11.tar.gz";
5+
# Hash obtained using `nix-prefetch-url --unpack <url>`
6+
sha256 = "1250a3g9g4id46h9ysy5xfqnjf0yb2mfai366pyj5y2bzb8x0i2l";
67
}) {};
78

8-
pythonWithPryskDeps = pkgs.python3.withPackages (ps: with ps; [
9+
# Handle darwin-specific dependencies properly
10+
extra_deps = if pkgs.stdenv.isDarwin then [
11+
pkgs.darwin.apple_sdk.frameworks.Security
12+
pkgs.darwin.apple_sdk.frameworks.CoreFoundation
13+
pkgs.darwin.apple_sdk.frameworks.SystemConfiguration
14+
] else [];
15+
16+
# Python with packages needed for prysk
17+
pythonWithPackages = pkgs.python3.withPackages (ps: with ps; [
918
pip
1019
setuptools
20+
wheel
1121
]);
1222
in
13-
pkgs.mkShell {
14-
buildInputs = [
15-
pkgs.git
16-
pkgs.tree
17-
pkgs.cargo
18-
pkgs.rustc
19-
pkgs.trunk
20-
pkgs.rustfmt
21-
pkgs.libiconv
22-
pkgs.openssl.dev
23-
pkgs.pkg-config
24-
pkgs.nodejs
25-
pythonWithPryskDeps
26-
];
27-
RUST_BACKTRACE = 1;
28-
29-
shellHook = ''
30-
echo "Welcome to Josh development environment!"
31-
echo "Rust version: $(rustc --version)"
32-
echo "Cargo version: $(cargo --version)"
33-
34-
# Install prysk using pip in a virtual environment
35-
if [ ! -d ".venv" ]; then
36-
echo "Creating Python virtual environment..."
37-
python3 -m venv .venv
38-
fi
39-
40-
source .venv/bin/activate
41-
42-
# Install or upgrade prysk
43-
echo "Installing/updating prysk..."
44-
pip install --upgrade pip
45-
pip install --upgrade prysk
46-
47-
echo "Prysk installed: $(prysk --version 2>/dev/null || echo 'Run prysk --help for usage')"
48-
'';
49-
}
23+
pkgs.mkShell {
24+
buildInputs = [
25+
pkgs.git
26+
pkgs.tree
27+
pkgs.cargo
28+
pkgs.rustc
29+
pkgs.trunk
30+
pkgs.rustfmt
31+
pkgs.libiconv
32+
pkgs.openssl.dev
33+
pkgs.pkg-config
34+
pkgs.nodejs
35+
pythonWithPackages
36+
] ++ extra_deps;
37+
38+
RUST_BACKTRACE = 1;
39+
40+
shellHook = ''
41+
echo "Welcome to Josh development environment!"
42+
echo "Rust version: $(rustc --version)"
43+
echo "Cargo version: $(cargo --version)"
44+
echo "Python version: $(python3 --version)"
45+
46+
# Install prysk using pip in user space with specific version
47+
if ! command -v prysk &> /dev/null; then
48+
echo "Installing prysk..."
49+
pip install --user "prysk==0.20.0"
50+
else
51+
# Ensure we have the correct version
52+
pip install --user --upgrade "prysk==0.20.0"
53+
fi
54+
55+
echo "Prysk version: $(prysk --version 2>/dev/null || echo 'Installing...')"
56+
echo "Environment ready! Run tests with: ./run-tests.sh"
57+
'';
58+
}

0 commit comments

Comments
 (0)