-
Notifications
You must be signed in to change notification settings - Fork 25
/
flake.nix
43 lines (40 loc) · 1.32 KB
/
flake.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
{
description = "Codex build flake";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
circom-compat.url = "github:codex-storage/circom-compat-ffi";
};
outputs = { self, nixpkgs, circom-compat}:
let
stableSystems = [
"x86_64-linux" "aarch64-linux"
"x86_64-darwin" "aarch64-darwin"
];
forAllSystems = f: nixpkgs.lib.genAttrs stableSystems (system: f system);
pkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
in rec {
packages = forAllSystems (system: let
circomCompatPkg = circom-compat.packages.${system}.default;
buildTarget = pkgsFor.${system}.callPackage ./nix/default.nix {
inherit stableSystems circomCompatPkg;
src = self;
};
build = targets: buildTarget.override { inherit targets; };
in rec {
codex = build ["all"];
default = codex;
});
devShells = forAllSystems (system: let
pkgs = pkgsFor.${system};
in {
default = pkgs.mkShell {
inputsFrom = [
packages.${system}.codex
circom-compat.packages.${system}.default
];
# Not using buildInputs to override fakeGit and fakeCargo.
nativeBuildInputs = with pkgs; [ git cargo nodejs_18 ];
};
});
};
}