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

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
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
logicmason
Hi there, I'm working through my first release with elixir/phoenix. I've built a release with distillery and found that it crashes when I...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
chensan
I have a User schema with a :from_id field set to type :string: defmodule TweetBot.Repo.Migrations.CreateUsers do use Ecto.Migration ...
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
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
beno
I will often find my self writing things similar to: case some_value do nil -&gt; something() "" -&gt; something() _ -&gt; someth...
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New

Other popular topics Top

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
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 35421 110
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
lk-geimfari
What is most correct way to open, read and parse JSON file with poison? For example if we have example.json file in root of some projec...
New
vac
Hi, I'm quite new in Elixir and I'm trying to format a string to a PEM format. I have the certificate value like MIIDBTCCAe2...... and ...
New
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lis...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
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
AstonJ
by Lance Halvorsen Elixir and Phoenix are generating tremendous excitement as an unbeatable platform for building modern web application...
460 27162 124
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New

We're in Beta

About us Mission Statement