nix-community / lorri

Your project’s nix-env [maintainer=@Profpatsch,@nyarly]
Apache License 2.0
639 stars 24 forks source link

Lorri cannot build shell.nix with network accessv #86

Closed yorodm closed 1 year ago

yorodm commented 2 years ago

Hello:

I have the following code in my shelHook

    if [ ! -d $MIX_HOME ]; then
        echo "Install hex and rebar..."
        mix local.hex --force
        mix local.rebar --force
    fi

It's intended to set up my Elixir environment in the local directory if it's not already set. The mix commands fail when running within lorri

To Reproduce Create the shell.nix with the code above

Expected behavior

nix-shell is able to create the derivation and execute the hooks, I believe lorri should do so too.

** Additional info

Thanks in advance

Profpatsch commented 1 year ago

Hi!

When you use lorri, the shellHook runs inside of a nix build, so accessing the network is unfortunately not possible. If you want to access the network, I recommend putting it directly into your .envrc for now.

yorodm commented 1 year ago

Thanks a lot!! I was starting with nix at the moment and the behavior was confusing. After a couple of months I understand better how everything should work. Thanks for your answer and thanks to the creators and contributors of this amazing tool