RooSoft October 23, 2025, 12:41pm 1 Simple question from someone who loves both NixOS and Elixir…
Is there someone around here that is able to do these two simple things:
Generate a basic Liveview app Package it for Nix, ideally in a flake That’s it… no extra code whatsoever. I’ve been spending a unholy amount of time trying to realize that achievement but have been failing so far.
The main problem revolves around the fact that the heroicons dependency is directly linked to GitHub instead of the hex package manager.
My whole infra is based on NixOS, so, I am considering quitting Elixir just to be able to get things done.
2 Likes
NobbZ October 23, 2025, 12:52pm 2 Do you mid sharing a minimal project that shows the problem?
I do not remember having had any problems when I packaged a small, fresh from the generator, application about a year ago.
2 Likes
I have such a project here: GitHub - Munksgaard/flakify
Right now, it just creates a flake.nix containing a devshell, but I have plans to extend it with a package output building the phoenix application.
2 Likes
I just made the simplest possible way to achieve what I am talking about here:
Attempt to package a Phoenix LiveView app for Nix
In short, it’s a brand new Phoenix Liveview app with no extra code, along with 3 nix files.
It’s all explained in the README.md, including the output of a failed attempt.
1 Like
Making a development environment is working great.
Works out of the box with the above repo just by typing nix develop.
Problem arises when I try to create a derivation out of the app.
Yep. That’s on my todo-list. I’ll see if I can get something workable out later this week.
1 Like
A working fork or pull request of this very project would be VERY appreciated. Thanks!
1 Like
Zurga October 23, 2025, 7:59pm 8 I have a setup here that I use for deployments: GitHub - Zurga/phoenix_nix
1 Like
I’ve just released version v0.3.0 of flakify. Take a look: Flakify — flakify v0.3.0
2 Likes
This is pretty cool! I might incorporate some of your ideas in flakify, if you don’t mind.
Zurga October 24, 2025, 8:34am 11 Yes, sure. Send me a message if you have any questions.
1 Like
RooSoft October 24, 2025, 12:20pm 12 In theory, this is exactly what I needed, thank you very much!
Although, it actually crashes on my plain Phoenix Liveview app with added nix files: GitHub - RooSoft/nix_package: Attempt to package a Phoenix LiveView app for Nix
Steps I made (note that I started by removing all nix files):
rm *.nix mix archive.install hex igniter_new mix igniter.install flakify --package Result:
** (Protocol.UndefinedError) protocol Enumerable not implemented for type Rewrite (a struct). This protocol is implemented for the following type(s): DBConnection.PrepareStream, DBConnection.Stream, Date.Range, Ecto.Adapters.SQL.Stream, File.Stream, Function, GenEvent.Stream, HashDict, HashSet, IO.Stream, Jason.OrderedObject, List, Map, MapSet, Phoenix.LiveView.LiveStream, Postgrex.Stream, Range, Req.Response.Async, Stream Maybe adding to the docs that mix archive.install hex igniter_new is required. I had to figure out that part as I’ve never used igniter in the past.
RooSoft October 24, 2025, 12:31pm 13 Works perfectly on brand new projects, though… back at getting things done.
Thank you @munksgaard !
1 Like
That’s strange. I didn’t get any errors when I tried to run it in your repo. Do you have any more details on the error, such as a stack trace?
RooSoft October 24, 2025, 1:30pm 15 Nevermind… maybe I was in a strange shell state.
Working flawlessly now. Huge thanks to you!
2 Likes
RooSoft October 24, 2025, 1:35pm 16 The project has been updated with code generated by flakify and is thus now in a working state.
committed 01:34PM - 24 Oct 25 UTC
1 Like
That’s great to hear, thanks for letting me know.
You mention in your original post that your infra is based on NixOS. Can you go into more depth on what it is that you desire? I think there’s a potential for Flakify to support generating NixOS modules or even deploy-rs based deployments, but what does your setup look like? What do you need?
3 Likes