lang-zoo/flake.nix

54 lines
1.4 KiB
Nix

{
description = "language zoo";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/master";
ocaml.url = "github:nix-ocaml/nix-overlays";
ocaml.inputs.nixpkgs.follows = "nixpkgs";
flake-parts.url = "github:hercules-ci/flake-parts";
};
outputs = inputs@{ self, flake-parts, nixpkgs, ocaml }:
let
ocamlModule = {
config.perSystem = { system, ... }: {
config._module.args.pkgs = import nixpkgs {
inherit system;
overlays = [
ocaml.overlays.${system}
(_: prev: {
ocaml = prev.ocaml-ng.ocamlPackages_latest.ocaml;
ocamlPackages = prev.ocaml-ng.ocamlPackages_latest;
})
];
};
};
};
in
flake-parts.lib.mkFlake { inherit inputs; } {
imports = [ ocamlModule ];
systems = [ "x86_64-linux" "aarch64-darwin" ];
perSystem = { config, self', inputs', pkgs, system, ... }: {
devShells.default = pkgs.mkShell {
nativeBuildInputs = builtins.attrValues {
inherit (pkgs.ocamlPackages)
dune
ocaml
;
};
buildInputs = builtins.attrValues {
inherit (pkgs.ocamlPackages)
dune
merlin
ocaml
ocaml-lsp
ocamlformat
ocamlformat-rpc-lib
utop
;
};
};
};
};
}