parser, nix, project setup
This commit is contained in:
commit
947e666706
22 changed files with 651 additions and 0 deletions
94
flake.nix
Normal file
94
flake.nix
Normal file
|
@ -0,0 +1,94 @@
|
|||
{
|
||||
inputs = {
|
||||
# nixpkgs.url = "github:nixOS/nixpkgs";
|
||||
nixpkgs.follows = "ocaml-overlay/nixpkgs";
|
||||
ocaml-overlay = {
|
||||
url = "github:nix-ocaml/nix-overlays";
|
||||
};
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
};
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
flake-utils,
|
||||
ocaml-overlay,
|
||||
}: let
|
||||
version = builtins.toString self.lastModified;
|
||||
in
|
||||
flake-utils.lib.eachDefaultSystem (
|
||||
system: let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
overlays = [
|
||||
ocaml-overlay.overlays.default
|
||||
];
|
||||
extra-substituters = "https://anmonteiro.nix-cache.workers.dev";
|
||||
extra-trusted-public-keys = "ocaml.nix-cache.com-1:/xI2h2+56rwFfKyyFVbkJSeGqSIYMC/Je+7XXqGKDIY=";
|
||||
};
|
||||
inherit (pkgs) mkShell ocaml-ng;
|
||||
inherit
|
||||
(ocaml-ng.ocamlPackages_5_2)
|
||||
dune_3
|
||||
ocaml
|
||||
utop
|
||||
ocaml-lsp
|
||||
ocamlformat
|
||||
ocamlformat-rpc-lib
|
||||
angstrom
|
||||
angstrom-unix
|
||||
faraday
|
||||
ppx_inline_test
|
||||
;
|
||||
minimal = [
|
||||
dune_3
|
||||
ocaml
|
||||
angstrom
|
||||
angstrom-unix
|
||||
faraday
|
||||
ppx_inline_test
|
||||
];
|
||||
dev = [
|
||||
utop
|
||||
ocaml-lsp
|
||||
ocamlformat
|
||||
ocamlformat-rpc-lib
|
||||
];
|
||||
in {
|
||||
devShells.default = mkShell {
|
||||
buildInputs = minimal ++ dev;
|
||||
};
|
||||
|
||||
packages.default = pkgs.callPackage ./nix/default.nix {ocaml-deps = minimal; inherit version;};
|
||||
|
||||
defaultPackage = self.packages.${system}.default;
|
||||
}
|
||||
)
|
||||
// {
|
||||
nixosModules.culr = import ./nix/module.nix {overlay = self.overlays.culr;};
|
||||
|
||||
overlays.culr = final: prev: let
|
||||
inherit
|
||||
(prev.ocaml-ng)
|
||||
dune_3
|
||||
ocaml
|
||||
angstrom
|
||||
angstrom-unix
|
||||
faraday
|
||||
ppx_inline_test
|
||||
;
|
||||
ocaml-deps = [
|
||||
dune_3
|
||||
ocaml
|
||||
angstrom
|
||||
angstrom-unix
|
||||
faraday
|
||||
ppx_inline_test
|
||||
];
|
||||
in {
|
||||
meat = final.callPackage ./nix/default.nix {
|
||||
inherit ocaml-deps version;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue