Onor.io

Onor.io

Nix Flake Template for Elixir?

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).

Most Liked

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
zimt28

zimt28

Last Post!

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.

Where Next?

Popular in Questions Top

jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" =&gt; #BSON.ObjectId&lt;58eb1a7a9ad169198c3dXXXX&gt;, "email" =&gt; ...
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New

Other popular topics Top

grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 54260 488
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New
chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 31586 112
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New

We're in Beta

About us Mission Statement