Skip to content

Commit e1800bc

Browse files
authored
Merge pull request #34 from Chobbes/nix-ci
Nix build + CI
2 parents 07b2423 + b63945d commit e1800bc

File tree

5 files changed

+239
-0
lines changed

5 files changed

+239
-0
lines changed

.envrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
use flake
2+
unset COQPATH

.github/workflows/nix-build.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: "Build ctrees under nix"
2+
on:
3+
pull_request:
4+
push:
5+
jobs:
6+
tests:
7+
strategy:
8+
matrix:
9+
os:
10+
- ubuntu-latest
11+
runs-on: ${{ matrix.os }}
12+
permissions:
13+
id-token: "write"
14+
contents: "read"
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: DeterminateSystems/nix-installer-action@v19
18+
- uses: DeterminateSystems/magic-nix-cache-action@v13
19+
- uses: DeterminateSystems/flake-checker-action@v12
20+
- name: Run nix build
21+
run: nix build .

Readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Choice Trees
22
[![Docker CI](https://github.com/vellvm/ctrees/workflows/Docker%20CI/badge.svg?branch=master)](https://github.com/vellvm/ctrees/actions?query=workflow:"Docker%20CI")
3+
[![Nix](https://github.com/vellvm/ctrees/actions/workflows/nix-build.yml/badge.svg)](https://github.com/vellvm/ctrees/actions/workflows/nix-build.yml)
34

45
We develop a cousin of Interaction Trees, dubbed _ctrees_ with native support for internal non-determinism.
56

flake.lock

Lines changed: 111 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
{
2+
description = "CTrees: a cousin of Interaction Trees, dubbed Choice Trees, with native support for non-determinism.";
3+
4+
inputs = {
5+
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
6+
flake-utils.url = "github:numtide/flake-utils";
7+
nix-filter.url = "github:numtide/nix-filter";
8+
coinduction-repo = {
9+
url = "github:damien-pous/coinduction";
10+
flake = false;
11+
};
12+
relation-algebra-repo = {
13+
url = "github:damien-pous/relation-algebra";
14+
flake = false;
15+
};
16+
};
17+
18+
outputs = { self, nixpkgs, flake-utils, nix-filter, coinduction-repo, relation-algebra-repo }:
19+
flake-utils.lib.eachDefaultSystem (system:
20+
let
21+
pkgs = import nixpkgs { inherit system; };
22+
lib = pkgs.lib;
23+
rocq = pkgs.rocq-core;
24+
rocqPkgs = pkgs.rocqPackages_9_0;
25+
coqPkgs = pkgs.coqPackages_9_0;
26+
27+
coinduction = rocqPkgs.callPackage
28+
( { rocq, stdenv }:
29+
rocqPkgs.mkRocqDerivation {
30+
owner = "damien-pous";
31+
pname = "coinduction";
32+
version = "coinduction:master";
33+
src = coinduction-repo;
34+
35+
buildInputs =
36+
with rocqPkgs;
37+
with coqPkgs;
38+
with rocq.ocamlPackages;
39+
[ ocaml camlp5 rocq pkgs.coq dune_3 stdlib rocq-core findlib ];
40+
propagatedBuildInputs =
41+
with rocqPkgs;
42+
with coqPkgs;
43+
with rocq.ocamlPackages;
44+
[ rocq ];
45+
}) { inherit rocq; } ;
46+
47+
relation-algebra = rocqPkgs.callPackage
48+
( { rocq, stdenv }:
49+
rocqPkgs.mkRocqDerivation {
50+
owner = "damien-pous";
51+
pname = "relation-algebra";
52+
version = "relation-algebra:master";
53+
src = relation-algebra-repo;
54+
55+
buildInputs =
56+
with rocqPkgs;
57+
with coqPkgs;
58+
with rocq.ocamlPackages;
59+
[ ocaml camlp5 rocq pkgs.coq dune_3 stdlib rocq-core findlib ];
60+
propagatedBuildInputs =
61+
with rocqPkgs;
62+
with coqPkgs;
63+
with rocq.ocamlPackages;
64+
[ rocq ];
65+
}) { inherit rocq; } ;
66+
in rec {
67+
packages = {
68+
default =rocqPkgs.callPackage
69+
( { rocq, stdenv }:
70+
rocqPkgs.mkRocqDerivation {
71+
owner = "vellvm";
72+
pname = "ctrees";
73+
version = "ctrees:dev";
74+
opam-name = "coq-ctree";
75+
useDune = true;
76+
src = ./.;
77+
78+
buildInputs =
79+
with rocqPkgs;
80+
with coqPkgs;
81+
with rocq.ocamlPackages;
82+
[ ocaml camlp5 rocq pkgs.coq dune_3 ITree coinduction relation-algebra stdlib equations ExtLib zarith findlib ];
83+
propagatedBuildInputs = [ rocq ];
84+
85+
}) { inherit rocq; };
86+
};
87+
88+
defaultPackage = packages.default;
89+
90+
app.default = flake-utils.lib.mkApp { drv = packages.default; };
91+
92+
devShells = {
93+
default = pkgs.mkShell {
94+
inputsFrom = [ packages.default];
95+
buildInputs = [ ];
96+
shellHook = ''
97+
unset COQPATH
98+
'';
99+
};
100+
};
101+
102+
devShell = devShells.default;
103+
});
104+
}

0 commit comments

Comments
 (0)