Skip to content

Commit 9b8492d

Browse files
committed
Add nix.flake for easy devshell.
1 parent 2679b11 commit 9b8492d

File tree

4 files changed

+310
-1
lines changed

4 files changed

+310
-1
lines changed

.envrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
use flake

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,4 +186,6 @@ Sessionx.vim
186186
*~
187187
.*.swp
188188
# Auto-generated tag files
189-
tags
189+
tags
190+
# nix flake stuff
191+
.direnv

flake.lock

Lines changed: 173 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: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
{
2+
# hiwell
3+
description = "neoburgh";
4+
5+
inputs = {
6+
nixpkgs = {
7+
url = "github:nix-ocaml/nix-overlays";
8+
inputs.flake-utils.follows = "flake-utils";
9+
};
10+
11+
ocaml-overlay = {
12+
url = "github:nix-ocaml/nix-overlays";
13+
inputs.nixpkgs.follows = "nixpkgs";
14+
};
15+
16+
flake-utils = {
17+
url = "github:numtide/flake-utils";
18+
};
19+
20+
quickjs = {
21+
type = "git";
22+
url = "https://github.com/ml-in-barcelona/quickjs.ml.git";
23+
submodules = true;
24+
flake = false;
25+
};
26+
27+
server-reason-react = {
28+
url = "github:ml-in-barcelona/server-reason-react";
29+
flake = false;
30+
};
31+
};
32+
33+
outputs =
34+
inputs@{
35+
self,
36+
nixpkgs,
37+
flake-utils,
38+
...
39+
}:
40+
flake-utils.lib.eachDefaultSystem (
41+
system:
42+
let
43+
version = "0.59.2+dev";
44+
pkgs = nixpkgs.legacyPackages."${system}".extend (
45+
self: super: {
46+
ocaml = super.ocaml-ng.ocamlPackages_5_1;
47+
ocamlPackages = super.ocaml-ng.ocamlPackages_5_1;
48+
# .overrideScope (
49+
# oself: osuper: { ppxlib = osuper.ppxlib.override ({ version = "0.32.1"; }); }
50+
# );
51+
}
52+
);
53+
inherit (pkgs) ocamlPackages mkShell;
54+
inherit (ocamlPackages) buildDunePackage;
55+
56+
quickjs = buildDunePackage {
57+
pname = "quickjs";
58+
version = "";
59+
propagatedBuildInputs = with ocamlPackages; [
60+
dune_3
61+
ocaml
62+
integers
63+
ctypes
64+
];
65+
src = inputs.quickjs;
66+
};
67+
68+
server-reason-react = buildDunePackage {
69+
pname = "server-reason-react";
70+
version = "";
71+
nativeBuildInputs = with ocamlPackages; [
72+
reason
73+
melange
74+
];
75+
propagatedBuildInputs = with ocamlPackages; [
76+
dune_3
77+
ocaml
78+
ppxlib
79+
melange
80+
quickjs
81+
lwt
82+
lwt_ppx
83+
integers
84+
uri
85+
];
86+
src = inputs.server-reason-react;
87+
};
88+
in
89+
{
90+
devShells = {
91+
default = mkShell.override { stdenv = pkgs.clang18Stdenv; } {
92+
buildInputs = with ocamlPackages; [
93+
dune_3
94+
ocaml
95+
utop
96+
ocamlformat
97+
];
98+
inputsFrom = [ self.packages."${system}".default ];
99+
packages = builtins.attrValues {
100+
inherit (pkgs) clang_18 clang-tools_18 pkg-config;
101+
inherit (ocamlPackages) ocaml-lsp ocamlformat-rpc-lib;
102+
};
103+
};
104+
};
105+
packages = {
106+
default = buildDunePackage {
107+
inherit version;
108+
pname = "styled-ppx";
109+
nativeBuildInputs = with ocamlPackages; [ ];
110+
propagatedBuildInputs = with ocamlPackages; [
111+
alcotest
112+
dune_3
113+
fmt
114+
melange
115+
menhir
116+
ocaml
117+
ppx_deriving
118+
ppx_deriving_yojson
119+
ppxlib
120+
reason
121+
reason-react
122+
reason-react-ppx
123+
sedlex
124+
server-reason-react
125+
yojson
126+
];
127+
src = ./.;
128+
};
129+
};
130+
formatter = pkgs.alejandra;
131+
}
132+
);
133+
}

0 commit comments

Comments
 (0)