-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshell.nix
More file actions
59 lines (50 loc) · 1.72 KB
/
Copy pathshell.nix
File metadata and controls
59 lines (50 loc) · 1.72 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
# Nix shell environment for the id project.
#
# This shell.nix uses the exact same versions as flake.nix by reading
# the flake.lock file for reproducible builds without requiring flakes.
#
# Usage:
# nix-shell # Enter development environment
# nix-shell --pure # Enter isolated environment
# nix-shell --run "just test" # Run tests
# nix-shell --run "just check" # Run all checks
#
# For flake users: `nix develop` provides an equivalent environment.
let
# Read flake.lock to get exact versions
flakeLock = builtins.fromJSON (builtins.readFile ./flake.lock);
# Extract locked versions from flake.lock
nixpkgsLock = flakeLock.nodes.nixpkgs.locked;
rustOverlayLock = flakeLock.nodes.rust-overlay.locked;
# Fetch nixpkgs with exact hash from flake.lock
nixpkgs = fetchTarball {
url = "https://github.com/${nixpkgsLock.owner}/${nixpkgsLock.repo}/archive/${nixpkgsLock.rev}.tar.gz";
sha256 = nixpkgsLock.narHash;
};
# Fetch rust-overlay with exact hash from flake.lock
rustOverlay = fetchTarball {
url = "https://github.com/${rustOverlayLock.owner}/${rustOverlayLock.repo}/archive/${rustOverlayLock.rev}.tar.gz";
sha256 = rustOverlayLock.narHash;
};
pkgs = import nixpkgs {
overlays = [ (import rustOverlay) ];
};
# Import shared configuration (defines rustToolchain, fmtBins, nativeBuildInputs)
nixCommon = import ./nix-common.nix { inherit pkgs; };
in
pkgs.mkShell {
name = "id-dev";
inherit (nixCommon)
buildInputs
shellHook
nativeBuildInputs
TREEFMT_TREE_ROOT_CMD
;
# OpenSSL configuration for native builds
inherit (nixCommon.opensslEnv)
OPENSSL_DIR
OPENSSL_LIB_DIR
OPENSSL_INCLUDE_DIR
PKG_CONFIG_PATH
;
}