[Nix-dev] nix-shell unpackPhase does not work on my system
Massimo Zaniboni
massimo.zaniboni at gmail.com
Thu Aug 20 19:05:41 CEST 2015
Hi,
if I *not install*
nix-env -i bash
and I execute the command
nix-shell '<nixpkgs>' -A hello
I don't enter into a nix-shell environment, but there is no error
message, and also
echo $?
0
signals that it is all ok. But this is not the case, because the
nix-shell never started: the prompt remain the normal prompt, and not
the nix-shell special prompt. So this is a bad behaviour of nix-shell
that at least must signal an error message.
On the contrary if I * first install*
nix-env -i bash
then
nix-shell '<nixpkgs>' -A hello
starts correctly, also if I'm calling it from the native bash of Mint,
and not from the bash of Nix. Probably nix-shell calls the bash of Nix,
and in this case it finds it because I installed it.
I'm probably in a strange case respect normal Nix usage, because I start
as normal user, with no Nix profile installed. So the bash shell is
always the bash of Mint in my case.
A work-around is inserting into the installation manual/wiki, the
suggested command
nix-env -i bash
so all nix-shell commands will work as expected.
Can be a proper analysis of the problem?
Regards,
Massimo
On 20/08/2015 18:27, Massimo Zaniboni wrote:
> Problem fixed :-) But the solution is a little "strange", and I don't
> know if it is better improving the Wiki.
>
> I installed the bash of Nix
>
> nix-env -i bash
>
> Then I executed
>
> bash
>
> Then nix-shell is working
>
> nix-shell '<nixpkgs>' -A hello
> unpackPhase
> configurePhase
> buildPhase
>
> On Nix
>
> which bash
> /home/zanibonim/.nix-profile/bin/bash
> bash-4.3$ bash --version
> GNU bash, versione 4.3.39(1)-release (x86_64-unknown-linux-gnu)
>
> On Mint
>
> which bash
> /bin/bash
> bash --version
> GNU bash, versione 4.3.11(1)-release (x86_64-pc-linux-gnu)
>
> So is it a requirement of Nix, that the hosting shell must be the same
> shell shipped with Nix?
>
> When I need to run Nix, I manually execute
>
> source /home/zanibonim/.nix-profile/etc/profile.d/nix.sh
>
> so by default in my case, the Bash shell is the shell shipped with Mint,
> because at login/startup, no Nix package is never called.
>
> Regards,
> Massimo
>
>
>
>
>
>
>
> On 20/08/2015 18:13, Massimo Zaniboni wrote:
>>> But on my Mint system, the nix-shell does not see the "configurePhase"
>>> and all other "*Phase" commands.
>>
>> I tried also on a Mint system installed from scratch on a distinct VM,
>> for excluding problems on my system.
>>
>>
More information about the nix-dev
mailing list