Skip to content

Commit

Permalink
chore: update flakes
Browse files Browse the repository at this point in the history
and remove opam2nix

Signed-off-by: Rudi Grinberg <[email protected]>

<!-- ps-id: 657afa13-fc3d-4997-aec4-9d0cf016647d -->
  • Loading branch information
rgrinberg committed Sep 27, 2023
1 parent c6cc715 commit 5680bb9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 207 deletions.
158 changes: 7 additions & 151 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

57 changes: 1 addition & 56 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,9 @@
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
opam-nix = {
url = "github:tweag/opam-nix";
inputs.opam-repository.follows = "opam-repository";
};
opam-repository = {
url = "github:ocaml/opam-repository";
flake = false;
};
};

outputs = { self, flake-utils, opam-nix, opam-repository, nixpkgs, ... }@inputs:
outputs = { self, flake-utils, nixpkgs, ... }@inputs:
let
package = "ocaml-lsp-server";
overlay = final: prev: {
Expand Down Expand Up @@ -49,7 +41,6 @@
inherit (pkgs.ocamlPackages) buildDunePackage;
fast = rec {

# these packages do not use opam2nix
jsonrpc = buildDunePackage {
pname = "jsonrpc";
version = "n/a";
Expand Down Expand Up @@ -107,44 +98,9 @@
doCheck = false;
};
};
on = opam-nix.lib.${system};
localPackages = {
jsonrpc = "*";
lsp = "*";
ocaml-lsp-server = "*";
};
devPackages = {
menhir = "*";
ppx_yojson_conv = "*";
cinaps = "*";
ppx_expect = "*";
ocamlfind = "1.9.2";
};
packagesFromNames = set:
(builtins.map (s: builtins.getAttr s scope)
(builtins.attrNames set));
allPackages = localPackages // devPackages;
scope =
(
let
scope =
on.buildOpamProject
{
repos = [ opam-repository ];
inherit pkgs;
resolveArgs = { with-test = true; };
}
package
./.
(allPackages);
in
scope.overrideScope' overlay
);
opam2nixPackages = nixpkgs.lib.filterAttrs (name: value: builtins.hasAttr name localPackages) scope;
in
{
packages =
opam2nixPackages //
rec {
# we have a package without opam2nix for easy consumption for nix users
default = pkgs.ocamlPackages.buildDunePackage {
Expand Down Expand Up @@ -190,17 +146,6 @@
};

devShells = {
opam2nix = pkgs.mkShell {
buildInputs = (with pkgs;
[
# dev tools
ocamlformat_0_24_1
yarn
dune-release
]) ++ packagesFromNames devPackages;
inputsFrom = packagesFromNames opam2nixPackages;
};

default = pkgs.mkShell {
buildInputs = (with pkgs;
[
Expand Down

0 comments on commit 5680bb9

Please sign in to comment.