lawik

lawik

Nerves Core Team

This is definitely mostly about Igniter, incidentally about Nerves and Phoenix.

Both of those projects have generators that create a mix project. The convention in Nerves is a “poncho” project, that is, not quite an umbrella. You put Phoenix as thing_ui and Nerves as thing_firmware.

The firmware project puts the UI project as a path dependency. You copy and modify a ton of Phoenix config over the the firmware project. Then you run locally or compile firmware for your device from the firmware project.

I want to make a generator that does this all for you. It seems like igniter would be very helpful for patching config and such. But I’m uncertain if the --with approach works here for igniter.new and to what extent Igniter helps for this journey. I am fundamentally generating two separate mix projects and tying them together a bit.

Showing Posts 1 to 8

lawik

lawik OP

Nerves Core Team

@zachdaniel what is more helpful around Igniter, ask question in Ash forum or ping you? :smiley:

Cause I didn’t see a space to put this in that made sense that you’d see :slight_smile:

zachdaniel

zachdaniel

Creator of Ash

We’ve got an “igniter” channel in the ash discord, but here is good too! I’ve updated my notification settings so I get pinged on igniter tagged posts going forward, thanks for the heads up :slight_smile:

So, to answer your question:

the current state of the world is that igniter.new very much expects to create a mix project at the moment. Another fundamental (current) limitation of igniter is that it expects to be run in the context of a single mix project (but you could read/add files from external to the project)

I think we could actually potentially build some kind of first class support for poncho projects into igniter.new or igniter.new_poncho even. But barring that, it would probably look something like this:

mkdir poncho
cd poncho 
mix igniter.new thing --with phx.new --install ....
mix igniter.new thing_firmware --install your,packages

Then depending on how the installer is packaged, you might just include your_installer in the list of packages being installed, or you’d add another call to something like mix nerves.create_and_copy_phoenix_app.

lawik

lawik OP

Nerves Core Team

My current thinking is to not make it a poncho in the end. But this still means juggling and merging between two generators :slight_smile:

zachdaniel

zachdaniel

Creator of Ash

:thinking: When you say not to make it a poncho in the end what do you mean? Maybe we can hop on a call some time and talk about what you’re looking to do?

lawik

lawik OP

Nerves Core Team

On vacation right now but can holler when I get goong on this.

Essentially I want to generate a Nerves mix project and a Phoenix mix project and then use igniter to work out ways to merge files that exist in both (such as config, mix.exs).

mayel

mayel

On a similar note, our poncho project uses plain text files to specify deps instead of placing them in mix.exs as we found that easier to programmatically edit but also makes it more composable (we can have different deps source files that are included or not based on env or compile flags). This works by including a short script with Code.eval_file("mess.exs") in mix.exs

Given that context, I’d love a way to be able to use igniter.install in the project, maybe with an escape hatch to call another function instead of Igniter.apply_and_fetch_dependencies ?

zachdaniel

zachdaniel

Creator of Ash

Igniter has a .igniter.exs file that can be used to configure these things, or we can try to detect things like this, but it definitely won’t work out of the box. Interested in exploring the idea though :+1:

axelson

axelson

Scenic Core Team

I wonder if it would first make sense to start by creating an igniter-powered version of mix phx.new and mix nerves.new, then you could adapt those to be able to work together (possibly within a single project) or work in a poncho fashion. Although maybe that’s what you have in mind already.

— 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
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
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
matt-savvy
Anyone here using Honeybadger? My Honeybadger account is being overwhelmed with noise from some bots. Seeing a lot of Bandit.HTTPError...
New
samoloth
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 Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
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 & 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

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews