christhekeele

christhekeele

Accessing a self-hosted hex registry from livebook

I’ve been playing around with a self-hosted hex package registry, and it’s working well.

I’m interested in using one of my self-hosted packages inside a livebook, but see no way to accomplish this—neither the Livebook settings nor Mix.install/2 seem to have a way to declare additional registries to search for packages from.

I’m essentially looking for a way to accomplish mix hex.repo add <name> <url> for my Livebook runtime.

Does anyone know if this is possible? I have found nothing in mix, hex, or livebook docs/issues about this, but wanted to solicit the wisdom of the crowd before submitting a feature request.

Marked As Solved

jonatanklosko

jonatanklosko

Creator of Livebook

How are you running Livebook? If you run with Escript and do mix hex.repo add, then I think Mix.install/2 should be able to pull packages from the repo with {:package, "~> 1.0", repo: "myrepo"}. For other deployments (Docker, Desktop) the Mix installation is separate from the system, perhaps you can try running System.shell("mix hex.repo add ...") in a Livebook session (any session, just once), so it adds package in the right context.

Also Liked

jonatanklosko

jonatanklosko

Creator of Livebook

Awesome! Btw. I think doing it once should be enough, since then the repo is already added to the Mix config. That said, having it in the notebook makes sure it works in new environments (and you may want to use Livebook secrets for the repo keys).

mruoss

mruoss

Not 100% sure but iiuc, a runtime is “just” an erlang node to Livebook. Where it runs shouldn’t matter.

Where Next?

Popular in Questions Top

9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod -- where is this set? Thanks.
New
sergio
In Ruby, I can go: User.find_by(email: "foobar@email.com").update(email: "hello@email.com") How can I do something similar in Elixir? ...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
mathew4509
I have a list say x = ["23gh", "56kh", "97mh"] I would like to pass each element to Val in each iteration. Say, in iteration 1 -------...
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
hpopp
To simplify some tasks at work, I wrote and published this package yesterday. It’s a simple macro that enables Access behaviour on struct...
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New

Other popular topics Top

shahryarjb
Hello, I get Persian date from my client and convert it to normal calendar like this: def jalali_string_to_miladi_english_number(persi...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
_russellb
I want to try my hand at web scraping. What tools/libraries do I need to use. I’m hoping to turn this into something professional so don’...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
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
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
AstonJ
We’ve put together this wiki for Phoenix LiveView - please feel free to add any info you feel is worth including. What is Phoenix LiveV...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
magnetic
Hey :wave:t3: Elixir community, I’ve been learning Elixir, and working on some side projects. My editor of choice is VSCode, and althoug...
New

We're in Beta

About us Mission Statement