You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While Mix to Nix is working well for building projects, I get an error while trying to use nix-env when a project has not been built yet.
We use nix-env to list all available derivations in our internal nix-overlay, so that we can make our CI server build each derivation in turn.
Now, if I create a dummy Elixir project using mix new, setup a default.nix according to the docs, and then call nix-env -f default.nix -qa --show-trace in that directory (without calling nix-build first), I get this:
error: while evaluating 'importElixir' at /nix/store/gz1a1xq552xg69r2iqsnk3hl4skdvslb-source/default.nix:240:18, called
from /nix/store/gz1a1xq552xg69r2iqsnk3hl4skdvslb-source/default.nix:259:19:
while evaluating 'importJSON' at /nix/store/nh38qpbmmrli8w3zqv00jv120chf1biz-nixos-18.09.1819.76aafbf4bf4/nixos/lib/trivial.nix:237:16, called from /nix/store/gz1a1xq552xg69r2iqsnk3hl4skdvslb-source/default.nix:240:24:
cannot read '/nix/store/yhhb0ih007drznbwd76h8khywbp8pyk1-elixir-term.json', since path '/nix/store/4jv30jsybmwlw9pjay3cm2a15dxkj1ki-elixir-term.json.drv' is not valid, at /nix/store/nh38qpbmmrli8w3zqv00jv120chf1biz-nixos-18.09.1819.76aafbf4bf4/nixos/lib/trivial.nix:238:24
It looks like some kind of bootstrapping problem to me, since the drv-path doesn't exist yet when we try to import it. I'm not fully understanding what to do about it, however. Any pointers? Thank you!
The text was updated successfully, but these errors were encountered:
Running nix-instantiate before will of course do the trick.
nix-instantiate, by itself, won't build these paths. Mix to Nix depends on build during eval. So the way to resolve it depends on what you want to achieve.
If you want to use something in conjunction with nix-env specifically, you might have better luck with nix-build -A name 2> /dev/null || true before nix-env.
That said, unless you want to list dependencies, name/version, or other derivation metadata, you can just list attribute names and have CI using go through them using the command in previous comment, which is what I think Hydra does.
This should be probably fixed upstream in nix-env, reopening as a reminder.
@olcai wrote on Feb 22, 2019 8:18am UTC:
The text was updated successfully, but these errors were encountered: