Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Cannot coerce null to a string" in buildMix #4

Open
lukateras opened this issue Aug 7, 2019 · 4 comments
Open

"Cannot coerce null to a string" in buildMix #4

lukateras opened this issue Aug 7, 2019 · 4 comments

Comments

@lukateras
Copy link
Member

@olcai wrote on Feb 7, 2019 2:44pm UTC:

Hi and thanks for this interesting project!

I just tried it out on two different Elixir projects, but I cannot get it work on either of them. After creating a default.nix just as described in the README and running nix-build I get the following output:

$ nix-build
error: cannot coerce null to a string, at /nix/store/nh38qpbmmrli8w3zqv00jv120chf1biz-nixos-18.09.1819.76aafbf4bf4/nixos/pkgs/development/beam-modules/build-mix.nix:32:13

I'm no Nix expert, but it seems that the issue is that name is not set when calling build-mix.nix. Does anyone have a good idea what could be wrong and how to fix it?

I'm running NixOS 18.09 on my end (although it seems to me that mix-to-nix is using a pinned version of nixpkgs).

@lukateras
Copy link
Member Author

@olcai wrote on Feb 7, 2019 3:17pm UTC:

Of course I found the issue just a short while after writing this issue.

After following the code in greater detail I could easily see that I need to set the app name and version in mix.exs for it to work.

Perhaps a small comment about this could be added to the README so that others won't stumble as I just did.

Thank you and sorry for the noise!

@lukateras
Copy link
Member Author

@yegortimoshenko wrote on Feb 7, 4:44pm UTC:

although it seems to me that mix-to-nix is using a pinned version of nixpkgs

pkgs.nix is used for CI and tests only, other than that Mix to Nix reuses user's <nixpkgs>.

Perhaps a small comment about this could be added to the README so that others won't stumble as I just did.

Sure! I thought that mix doesn't work on projects without name/version. Does it?

@lukateras
Copy link
Member Author

@olcai wrote on Feb 7, 2019 8:34pm UTC:

Sure! I thought that mix doesn't work on projects without name/version. Does it?

Yes, you can leave these fields out. The issue in my case is that I have applications in an umbrella, and therefore I had no name or version in the top-level mix file.

@lukateras
Copy link
Member Author

@yegortimoshenko wrote on Feb 7, 2019 8:41pm UTC:

In that case, Mix to Nix has to be fixed. Thanks for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant