-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathflake.nix
More file actions
26 lines (25 loc) · 826 Bytes
/
flake.nix
File metadata and controls
26 lines (25 loc) · 826 Bytes
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
{
description = "Train neural networks that distill into logic circuits, using JAX";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, utils }:
utils.lib.eachDefaultSystem (system:
with import nixpkgs { inherit system; }; {
defaultPackage = stdenv.mkDerivation {
name = "difflogic";
src = ./.;
nativeBuildInputs = [ (python3.withPackages (p: with p; [ p.jax p.einops p.optax ])) ];
buildPhase = ''
python main.py
${stdenv.cc.targetPrefix}cc $NIX_CFLAGS_COMPILE gate.c -o gate
'';
installPhase = ''
install -Dm755 -t $out/bin gate
'';
meta.mainProgram = "gate";
};
}
);
}