Onor.io

Onor.io

I apologize in advance if I am posting this in the wrong place.

I see a nix package for Elixir (in fact I see several). Big kudos to those folks who have taken the time to do this!

I want to create a nix flake for an Elixir app I’m working on and I can create a plain old nix flake but I was wondering if someone has already created a nix flake template for Elixir? Googling hasn’t turned up anything (although I may be using the wrong search terms).

Showing Posts 1 to 10

zimt28

zimt28

Onor.io

Onor.io OP

Thank you! That’s a big help!

shanesveller

shanesveller

I maintain some OSS Nix<->BEAM tooling, which offers flake init templates, support for ingesting asdf .tool-versions files, reusable dev shells and a few other niceties, based on flake-parts lib. Repo is here and feedback or critiques are welcome. Example usage is also documented here.

I’ve been iterating and daily driving it for a couple years at this point, and haven’t had asdf/mise/rtx installed at all in the last 18 months or so.

c4710n

c4710n

Hey, @Onor.io. Very happy to see that you like Nix.

After the post mentioned by @zimt28, my workflow improved a lot. If you continue to use Nix, I believe you will encounter some issues, like:

  1. How to init a project quickly?
  2. How to package an Elixir app as a Nix derivation?
  3. How to package an Elixir app as a Docker image with Nix?

I really like building Docker image with Nix Flake - I don’t have to sync .dockerignore with .gitignore anymore.

All above problems already have solutions, I hope the following links are also useful to you in the future.

  1. using Nix template: You can create your own nix-dev-template by following the-nix-way/dev-templates or c4710n/nix-dev-templates, etc.
  2. Check out nix-dev-templates/elixir/phoenix/nix/release.nix at 8c8ed3b805c043e2666124fa2b4e22067ca1d0df · nix-giant/nix-dev-templates · GitHub.
  3. Check out nix-dev-templates/elixir/phoenix/flake.nix at 8c8ed3b805c043e2666124fa2b4e22067ca1d0df · nix-giant/nix-dev-templates · GitHub
Onor.io

Onor.io OP

Thank you so much for the pointers Shane! I’m sure that will help me to progress with employing Nix with Elixir!

Onor.io

Onor.io OP

Thank you so much for providing those links!

Onor.io

Onor.io OP

Hi again Shane,

Just curious–do you ever use your nix stuff in order to build docker images? That’s one of the use cases I definitely wanted to try.

shanesveller

shanesveller

I use it and enjoy doing so for non-BEAM work, it works pretty well for Rust and Golang binaries, but the output for Elixir was somewhat inferior to a naive Dockerfile as of a year or two ago. The closure size was even larger than a normal Debian based image, but I never bothered to triage why or file issues or PRs to nixpkgs about it. Part of it was that it considered systemd(!) a propagated input.

If I wanted to make it work today I’d use the erlang_nox or erlang_minimal package set to omit wx stuff, and the recently file set support to make sure I didn’t get extra blobs from the source tree or spurious rebuilds.

Onor.io

Onor.io OP

Thanks Shane! I appreciate your insights on this!

onnimonni

onnimonni

Hey and sorry for visiting an old topic but this came to the top when searching for “nixos elixir” with Google.

Are there any public examples of using flakes to locally develop and to deploy an elixir based application to Nixos?

I’m using my own bare metal server to run this but using docker is alright too.

— All posts loaded —

Where Next? Top

Trending in Questions Top

Blokh
Hey guys, I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly Do you guys have any suggestions what is the best prac...
New
kszambelanczyk
Hello! Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app. I creat...
New
Onor.io
I have what I’ve heard referred to as a “lookup table” in my database. This is a way of assigning codes to common values. One common lo...
New
jaybe78
Hello, I’m developing a online persistent chat system (what’s app) like using elixir/dynamodb/aws for a mobile app(flutter). The diffic...
New
Trolleger
What approach to take when sending live updates to “random” users Hi! I have a question, I have a little chat app, and when I create a DM...
New
matt-savvy
Anyone here using Honeybadger? My Honeybadger account is being overwhelmed with noise from some bots. Seeing a lot of Bandit.HTTPError...
New
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New

Other Trending Topics Top

garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge &amp; Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
wintermeyer
There are three potential reasons for members of this forum to have a look at https://vutuv.de You are tired or annoyed of LinkedIn. Yo...
New
webofbits
Aludel - LLM Evaluation Workbench Aludel is an embeddable Phoenix LiveView dashboard for evaluating and comparing LLM prompts across mult...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews