flakify - easily set up Nix flake related tooling in your Elixir/Phoenix application

flakify is an igniter installer that allows you to quickly get a Nix flake-based development shell up and running for your Elixir/Phoenix project.

I use Nix with flakes for all my development environments (insert joke about “how do you know someone is using Nix”) including Elixir and Phoenix. When I start a new Phoenix project, I often find myself having to make the same small adjustments in order to be able to run the project inside a Nix development shell. If you’re like me, you find this quite annoying.

To scratch my own itch, I’ve created flakify, an Igniter installer that automates these small tasks for me. Right now it’s very simplistic, but I think there’s potential to expand the installer quite significantly, by adding support for compiling the Phoenix application as a Nix package, setting up NixOS modules and so on.

To use it, you need to have igniter installed, but then you can just run the following command to initialize a new Phoenix application with a corresponding flake.nix:

mix igniter.new your_new_web_app --install flakify --with phx.new

Please let me know if you find this useful. Any feedback is appreciated.

8 Likes

Why does nix shell install golang???

1 Like

Ah damn, I thought I’d remembered to remove that. I’ll release a fix later tonight.

A new release (0.2.0) has been released, removing the unnecessary go dependency.

2 Likes