I am exploring Nix (and eventually NixOS) by packaging an OCI container for my personal website project, a Elixir Phoenix application which is distributed as org-mode documents.
I integrated @hauleth 's nix-elixir pretty easily so far with this default.nix but I am having an issue with one of my transitive dependencies: it uses a
rebar3 plugin port_compiler which it attempts to download in the sandboxed
configurePhase … I see that
buildRebar3 can be directed to install and configure
compilePorts and whatnot but I’m not sure how to use the rebar3-nix-bootstrap in my derivation while keeping things pure, and i’m not sure how to structure this to be able to feed a bootstrapped rebar3 in to the configurePhase of my buildMix derivation.
i’ll admit, starting with an elixir project doesn’t seem like the best place to start learning how all these things are fit together but I’ve got to start somewhere and I’ve been bikeshedding on how to build docker images for this project for a while … I’m still quite green, reading through docs and the nix pills so bear with me if there’s an easy way to do this that I’m not considering.
as an aside, my first attempt here I was using a standard FOD derivation I’d constructed myself around a unsandbox’d
mix distillery.release in the
buildPhase but I was getting some obscure execve failures from erlexec trying to spawn EPMD when I started the docker container, so i moved to
mix release and
nix-elixir where I am now. I’m not sure this will resolve those issues since I haven’t got it to build yet and anyways the code and buildinputs are still basically the same, but I had a real fun time learning about Nix while learning about erlang release and bootup!
(I have two replies below that were written before this most recent update, sorry. It’s been a while since i’ve been on forums!)