-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
184 lines (162 loc) · 6.21 KB
/
flake.nix
File metadata and controls
184 lines (162 loc) · 6.21 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
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# SPDX-License-Identifier: PMPL-1.0-or-later
# SPDX-FileCopyrightText: 2025 Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
{
description = "ECHIDNA - Neurosymbolic theorem proving platform with 30 prover backends";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, flake-utils, rust-overlay }:
flake-utils.lib.eachDefaultSystem (system:
let
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs { inherit system overlays; };
rustToolchain = pkgs.rust-bin.stable.latest.default.override {
extensions = [ "rust-src" "rust-analyzer" "clippy" "rustfmt" ];
};
buildDeps = with pkgs; [
pkg-config
openssl
];
devTools = with pkgs; [
just
cargo-edit
cargo-audit
cargo-outdated
cargo-tarpaulin
cargo-deny
cargo-watch
jq
];
# Runtime prover dependencies (minimal — devShell default)
proverDeps = with pkgs; [
z3
cvc5
idris2
];
# Live-prover CI dependencies — mirror of manifests/live-provers.scm
# (Guix is PRIMARY per project CLAUDE.md; this flake is the fallback
# path for contributors without Guix and for cases where nixpkgs has a
# package Guix upstream doesn't yet — e.g. lean4, dafny.)
#
# Tiering mirrors ~/Desktop/ECHIDNA-PRODUCTION-WIRING-PLAN.md.
liveProverDeps = with pkgs; [
# --- Tier 1 — trivial (every PR)
z3 # SMT, deep wiring
cvc5 # SMT (nixpkgs has cvc5; Guix has cvc4 as stand-in)
alt-ergo # SMT
vampire # first-order ATP
eprover # first-order ATP
spass # first-order ATP
glpk # LP/MIP constraint solver (glpsol)
minizinc # constraint modelling
chuffed # CP solver (FlatZinc)
# --- Tier 2 — build-from-source / larger deps (nightly)
coq # Coq/Rocq
agda # dependent-type proof assistant
idris2 # dependent-type proof assistant
isabelle # HOL proof assistant
why3 # auto-active verifier
lean4 # Lean 4 — NOT in Guix upstream, so this is primary path
dafny # Dafny — NOT in Guix (dotnet dep), so this is primary
# hol-light # uncomment when nixpkgs attribute stable
# tlaps # uncomment when nixpkgs attribute stable
# fstar # uncomment when nixpkgs attribute stable
# --- Harness prerequisites
which
coreutils
];
in {
# Development shell (minimal — for day-to-day work)
devShells.default = pkgs.mkShell {
buildInputs = [ rustToolchain ] ++ buildDeps ++ devTools ++ proverDeps;
shellHook = ''
export RUST_LOG=echidna=debug,info
echo "ECHIDNA development environment"
echo ""
echo "Commands:"
echo " just build - Build debug"
echo " just test - Run unit tests"
echo " just test-all - Run all tests"
echo " just lint - Run clippy"
echo " just pre-commit - All checks"
'';
};
# Live-prover development shell — mirrors manifests/live-provers.scm.
# Use when running the live-prover test suite locally without Guix:
# nix develop .#live-provers -c cargo test --test live_prover_suite --features live-provers
devShells.live-provers = pkgs.mkShell {
buildInputs = [ rustToolchain ] ++ buildDeps ++ devTools ++ liveProverDeps;
shellHook = ''
export RUST_LOG=echidna=debug,info
export ECHIDNA_LIVE_PROVERS=1
echo "ECHIDNA live-prover environment (Nix fallback; Guix is primary)"
echo ""
echo "Run:"
echo " cargo test --test live_prover_suite --features live-provers"
'';
};
# Main package
packages.default = pkgs.rustPlatform.buildRustPackage {
pname = "echidna";
version = "1.5.0";
src = ./.;
cargoLock.lockFile = ./Cargo.lock;
nativeBuildInputs = with pkgs; [ pkg-config ];
buildInputs = with pkgs; [ openssl ];
# Only run unit tests (integration tests need provers)
checkPhase = ''
cargo test --lib
'';
meta = with pkgs.lib; {
description = "Neurosymbolic theorem proving platform with 30 prover backends";
homepage = "https://github.com/hyperpolymath/echidna";
license = licenses.free; # PMPL-1.0-or-later (https://github.com/hyperpolymath/palimpsest-license)
mainProgram = "echidna";
};
};
# Container image (OCI)
packages.container = pkgs.dockerTools.buildLayeredImage {
name = "echidna";
tag = "latest";
contents = [
self.packages.${system}.default
pkgs.cacert
pkgs.z3
pkgs.cvc5
pkgs.idris2
];
config = {
Cmd = [ "/bin/echidna" "--help" ];
Env = [
"RUST_LOG=info"
];
ExposedPorts = {
"8081/tcp" = {};
};
};
};
# CI checks
packages.ci = pkgs.stdenv.mkDerivation {
name = "echidna-ci";
src = ./.;
nativeBuildInputs = [ rustToolchain pkgs.pkg-config ];
buildInputs = with pkgs; [ openssl ];
buildPhase = ''
export HOME=$TMPDIR
cargo fmt --check
cargo clippy -- -D warnings
cargo test --lib
'';
installPhase = ''
mkdir -p $out
echo "CI checks passed" > $out/result
'';
};
}
);
}