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
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
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
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
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
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
Anyone here using Honeybadger?
My Honeybadger account is being overwhelmed with noise from some bots. Seeing a lot of
Bandit.HTTPError...
New
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
Other Trending Topics
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
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
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
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #blog-post
- #elixir-ls
- #ai
- #elixirconf-us
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










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.