nix-ocaml / nix-overlays

OCaml-focused, custom nix-overlays
MIT License
102 stars 24 forks source link

Cannot coerce a set into a string #611

Closed cdmistman closed 1 year ago

cdmistman commented 1 year ago

I'm on nix v2.13.0

When attempting to use your overlay in my shell.nix a la:

let
  nixpkgs = <nixpkgs>;
  ocaml-overlay = builtins.fetchTarball
      https://github.com/nix-ocaml/nix-overlays/archive/master.tar.gz;
in with import nixpkgs {
  overlays = [
    (import "${ocaml-overlay}/overlay" { inherit nixpkgs; })
  ];
}; ...

I get the error cannot coerce a set into a string pointing to https://github.com/nix-ocaml/nix-overlays/blob/1a1f0f82ea1d2fb37ab2e0f4a305f092f52f219a/ocaml/default.nix#L595

anmonteiro commented 1 year ago

How about using extraOverlays like here? https://github.com/anmonteiro/piaf/blob/master/nix/ci/test.nix#L10-L16

anmonteiro commented 1 year ago

oh nevermind, that's not using nixpkgs upstream. I'll take a look at this soon

anmonteiro commented 1 year ago

I think what you want is (import "${ocaml-overlay}/overlay" nixpkgs), not { inherit nixpkgs; }

cdmistman commented 1 year ago

ah, yes - that seems to fix it, thank you! Perhaps the readme should be updated to reflect this? Or is custom-nixpkgs variable expected to represent something else? (I'm new to nix, this is my first shell.nix file :) )

anmonteiro commented 1 year ago

The readme does look wrong. Wanna send a PR since you got it working?

cdmistman commented 1 year ago

Can do, I also want to add cohttp-eio to the overlay so I'll submit that in a separate PR 😄

anmonteiro commented 1 year ago

there's https://github.com/nix-ocaml/nix-overlays/pull/534 but there's a few problems

cdmistman commented 1 year ago

i've got time today and my project using cohttp isn't urgent - what needs to be done to make cohttp_async_websocket compatible?