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 having some trouble figuring out if I have set myself too strict of standards for my production server. Currently I can handle 75% of r...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
Hello,
I’m trying to build a basic Phoenix web-app, and I’d like to use Tailwind.
However, when I launch mix phx.server, I get an error...
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
I’m working on a small exercise involving update_in/3, and I came up with this solution:
data = %{
name: "Periodic Table",
category:...
New
I’ve got trouble wrapping my head around the order in which functions are called in this snippet (from Phoenix’s authentication):
toke...
New
Is there any way to avoid the Hologram compiler running when using iex? It seems like the front-end code could potentially be disregarded...
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
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
A little off-topic, but I feel like people here have a good head on their shoulders.
I used to be quite good at making software. Was luc...
New
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
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
- #ai
- #ecto-query
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #elixirconf-eu
- #api
- #forms
- #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.