water
Are there any known working resources to package using nix and deploy it?
I’ve tried:
But the basic liveview(mix phx.new) uses heroicons and I get errors when building it.
nix build
...
> Running phase: installPhase
> Unchecked dependencies for environment prod:
> * heroicons (https://github.com/tailwindlabs/heroicons.git - v2.1.1)
> lock mismatch: the dependency is out of date. To fetch locked version run "mix deps.get"
> ** (Mix) Can't continue due to errors on dependencies
...
Trending in Questions
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hello,
I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
Hi everyone,
I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding.
I sta...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
I’m new to elixir and just tried to install the elixirLS extension for VScode(ium) and it is throwing some errors that I would like help ...
New
Other Trending Topics
Edit: 2026 May 15 - This post is archived.
Mob is alive!!
Main docs: mob v0.7.11 — Documentation
A bit of explanation for the slightly c...
New
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Hi everyone!
The first release candidate for the Expert language server project is now available!
We’ve published a press release detai...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #ai
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #elixirconf-eu
- #metaprogramming
- #hex











Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
munksgaard
I’ve found the best resource to be the BEAM section of the nixpkgs manual. We’re currently building and deploying our platform using nix, and I used that guide as a starting point for the implementation.
I’ve been meaning to write a proper blog post about this at some point, but haven’t gotten around to it yet.
Do you have any specific questions you’d like help with?
Edit: You did actually pose a question, so let me try to help out:
What does your mix.exs and flake.nix look like?
Zurga
Maybe try to doing a
MIX_ENV=prod mix deps.get. If there is a lock mismatch, this could solve it.I am not a big fan of just throwing your working directory in as source. Any changes made to files that are not related would result in a rebuild of everything, and all files in directory that are not related to a deployment would also be included. I suggest using the documentation provided and mix2nix for dependencies.
water
error after running node2nix:
The error is correct, assets/package.json doesn’t exist
Are there any commands I (or nix) should be running?
These commands I’ve used
flake.nix
mix.exs
water
found: GitHub - jurraca/elixir-templates: Nix flake templates for Elixir projects · GitHub
and tried to add heroicons using fetchfromgithub.
But I still get the error.
flake.nix
Zurga
The heroicons github repo you are pointing to in your flake.nix is not a mix project.
water
I got it working to build the project’s flake with
nix build, but once I import the flake in my system’s flake it won’t build and shows an error.Does anyone know what can fix this?
commands:
project flake.nix
project shell.nix
system flake.nix
a system module
inspiration: GitHub - code-supply/nix-phoenix: Tools and instructions for starting Phoenix projects with Nix deployment · GitHub
Zurga
I think the problem is that the deps folder already exists in the build environment. This could be because the flake.nix has
src = ./.;. This is a great resource for learning how to include only the files you need in the build environment: Working with local files — nix.dev documentationTo clarify a bit more,
buildMixis going to get all the deps and compile them again based on thedeps.nixcontents.water
Now it
nixos-rebuildwithout errors.I just have to check the systemd service.
Thank you.
Zurga
Good to hear you got it working! I have gone through a similar process myself
.
I implemented the SystemD services in three different parts for deployment on my server :
If you want, you can structure the NixOS module in a way that you setup the database, nginx proxy, ssl from one configuration.
In my NixOS config I can do the following:
Any branch can be used to create a domain name with minimal configuration effort. Database names are just the name of the app with the branch as a suffix (maybe I will allow a explicit suffix in the config in the future). Having to specify the port is something I want to get rid of and just use Unix sockets instead. Using Systemd socket should allow for zero-downtime deployments, but there is still work to be done with regard to gen_tcp.
If you want to see how it works, I can post the aforementioned module in this thread.
water
Please do share.