Flakify

Easily set up a Nix flake-based development environment for your Elixir/Phoenix-project.

Usage

To create a new Phoenix project that's already initialized with a Nix flake, run the following command:

mix igniter.new flakify_test --install flakify --with phx.new --with-args="--no-ecto"

This will:

After performing the install, you should be able to run nix develop -c mix phx.server to run the Phoenix server using the flake development environment.

In an existing project, you can run:

mix igniter.install flakify

After running the installer, flakify will remove itself from your project dependencies.

Building a Mix release

When specifying --package (this is also the default), flakify will add a package derivation that builds a Mix release of the Elixir project. It relies on deps_nix to convert Mix dependencies to Nix derivations, so you will need to add the generated deps.nix to your git repository. After doing so, building should be as simple as:

$ nix build

The resulting release can be run by e.g. the following command:

PHX_SERVER=1 SECRET_KEY_BASE=`mix phx.gen.secret` RELEASE_COOKIE="secret" ./result/bin/your_app start

TODO