tweag / opam-nix

Turn opam-based OCaml projects into Nix derivations
MIT License
111 stars 33 forks source link

pin materialization `opam-repository` #38

Closed RyanGibb closed 1 year ago

RyanGibb commented 1 year ago

I want to use the same flake inputs (specifically opam-repository) for materialization so ended up creating a derivation that calls materializeOpamProject: https://github.com/RyanGibb/aeon/blob/f4ecf576a7f7cd8b882c221339bd071ddfa711d0/flake.nix#L44-L46

Is there a better way to do this? If not, is this worth documenting for others?

balsoft commented 1 year ago

I think this is indeed the right way to do it. I'll try to document it.

RyanGibb commented 1 year ago

Hi @balsoft. Thanks for https://github.com/tweag/opam-nix/commit/a98614af305ce44076cf244ea3a0b098f2be2254.

I think the eval command might need a --raw flag. Without it I get:

$ cat $(nix eval .#package-defs) > package-defs.json
cat: '"/nix/store/sgr1dpmc6g2y364d1gixx2a78v9vf2yg-package-defs.json"': No such file or directory

Whereas $ cat $(nix eval .#package-defs --raw) > package-defs.json works as intended.

Otherwise I think this closes this issue.

balsoft commented 1 year ago

Thanks, fixed