Skip to content

Commit

Permalink
Create one development environment per package
Browse files Browse the repository at this point in the history
  • Loading branch information
Niols committed Jun 20, 2023
1 parent 28dc453 commit 34f990a
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,15 @@

packages.default = self'.packages.with-nixpkgs;

devShells.default = pkgs.mkShell {
buildInputs = (with pkgs; [ headache ])
++ (with pkgs.ocamlPackages; [ ocaml-lsp ocp-indent ]);
inputsFrom = [ self'.packages.default ];
shellHook = config.pre-commit.installationScript;
};
## For each package, we define a corresponding devShell using its inputs
## and adding pre-commit hooks and development tools on top.
devShells = builtins.mapAttrs (_: package:
pkgs.mkShell {
buildInputs = (with pkgs; [ headache ])
++ (with pkgs.ocamlPackages; [ ocaml-lsp ocp-indent ]);
inputsFrom = [ package ];
shellHook = config.pre-commit.installationScript;
}) self'.packages;

pre-commit.settings.hooks = {
dune-opam-sync.enable = true;
Expand Down

0 comments on commit 34f990a

Please sign in to comment.