Nix-elixir and dependencies with port compilation?

i spent some more time on this over the weekend with clearer eyes and another look at that documentation, thanks for pointing me back towards it. I still haven’t got it working, but I do have a better understanding of things…

  • erlang/elixir nixpkgs layout really makes things tougher to consider from the outside but this packagesWith helper is used to inject the new derivations in to the various interpreter configurations under nixpkgs.beam.interpreters and i use that in my default.nix
  • https://github.com/hauleth/nix-elixir/blob/8bdf6e73e3c5fa0706b2d1936bceb1baf692ed96/lib/build-mix.nix inherits a bunch of stuff out of nixpkgs for its initialization function call based on my understanding of how callPackage works so I should be able to override these since that is a function call and not a derivation; if i can do so, I can override it with a rebar3 derivation which has the attribute overridden: rebar3.overrideAttrs(oldAttrs: { compilePorts=true; });

I figure the right way to do this is probably in an overlay applied before nix-elixir is applied. so i used that packagesWith pattern to define an overlay which does cause a custom derivation of rebar3 to come in to the buildMix'' derivation and my buildMix'' derviation is invoked, but the buildPhase fails still trying to install the port compiler plugin for one of my deps…

I am not sure how to tell if my overlay worked, and if it did work I can’t tell if fetchMixDeps is using it, and it’s not clear to me how to proceed; the rebar.config in my rebar3 source directory doesn’t have the pc configuration in it

I’m going to just shelve this i guess until RFC fixing build-mix · Issue #105002 · NixOS/nixpkgs · GitHub is completed and then try using that in whatever form it shapes up to …

1 Like