<p>I had trouble getting the plutus playground environment to run properly until I followed the directions in this link <a href="https://docs.plutus-community.com/docs/setup/Ubuntu.html" rel="nofollow noreferrer">https://docs.plutus-community.com/docs/setup/Ubuntu.html</a> and first did the uninstall at the bottom of the page and did the re-install (as explained on the same page from the link provided above) for multiple-user. The multi-user version is recommended on the actual Nix website.  When I got to this line &quot;Note If you will be working on the Plutus Pioneer Project, it will be necessary at this point to git checkout ... a specific commit to match the class materials. That commit hash is listed in the exercises week## directory in the cabal.project&quot;, I followed along with the tutorial listed below to compile the &quot;English Auction&quot; code from week01:  <a href="https://youtu.be/zPaDp4R9X7o?t=177" rel="nofollow noreferrer">https://youtu.be/zPaDp4R9X7o?t=177</a>  Your folders might vary from the instructors, so listen carefully to where you clone the repositories he mentions.</p>

CC BY-SA 4.0
2022-01-17T12:20:18.880Z
Thanks! I'm aware of the specific commit for the repo, like I said everything works after I do `source /home/xxx/.nix-profile/etc/profile.d/nix.sh` each time entering `nix-shell`. I believe the path environment somehow is overwritten incorrectly after `nix-shell`, but don't know where to change it.
Cyrus
CC BY-SA 4.0
2022-01-20T02:41:09.057Z
Perhaps related, I think I must have installed Nix twice, or a build or shell, still learning, but I think I created two different profile-link-1 and profile-link-2 in the directory /nix/var/nix/profiles/per-user/<username>.  When I do a `nix doctor --verbose` I was getting a multiple versions fail (https://cardano.stackexchange.com/questions/6648/nix-doctor-verbose-fail-multiple-versions-of-nix-found-in-path-on-macos-i7). Maybe someone smarter than me can help on how this happens, and if linked.
TheStophe
CC BY-SA 4.0
2022-01-22T10:20:23.450Z
As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer).
Community
CC BY-SA 4.0
2022-01-16T19:45:51.470Z
2022-01-16T19:45:51.470Z
Chris Ossman
<p>Every time I enter <code>nix-shell</code>, I need to execute the following command, otherwise <code>nix-build</code> and other <code>nix-*</code> commands are not found.</p>
<pre><code>source /home/xxx/.nix-profile/etc/profile.d/nix.sh
</code></pre>
<p>I have added the following into file <code>~/.profile</code>, but it does not seem to be working.</p>
<pre><code>if [ -e /home/xxx/.nix-profile/etc/profile.d/nix.sh ]; then source /home/xxx/.nix-profile/etc/profile.d/nix.sh; fi # added by Nix installer
</code></pre>
<p>What's the reason for that? How can I get <code>source /home/xxx/.nix-profile/etc/profile.d/nix.sh</code> automatically when I run <code>nix-shell</code>?</p>

CC BY-SA 4.0
2022-01-16T03:45:51.040Z
Welcome to Cardano SE! As a new user be sure to take the [Tour].
Also, this seems to be a nix question rather than a Cardano question and it should not be on this site if that is the case.
gRebel
CC BY-SA 4.0
2022-01-16T13:44:39.603Z
This is fairly odd and should not happen. `nix-shell` would know how to set your profile. So what you are saying is it works in your regular shell, but fails in `nix-shell`. Can you please provide more info around the context? What system do you run on, ...?
angerman
CC BY-SA 4.0
2022-01-16T20:26:03.787Z
Yes, context information is going to be essential to find the problem here. Perhaps the shell is overwritting the PATH a bit too aggresively. If you have a link or a relevant snippet from the shell.nix, please share
nrdxp
CC BY-SA 4.0
2022-01-17T12:11:53.527Z
Thanks @nrdxp! I'm running on Ubuntu, I run `shell.nix` from [plutus-apps](https://github.com/input-output-hk/plutus-apps/blob/main/shell.nix), should I change the this file somehow?
Cyrus
CC BY-SA 4.0
2022-01-17T12:13:23.733Z
Hi @gRebel, I had this problem when I run `plutus-apps` for plutus pioneer program.
Cyrus
CC BY-SA 4.0
2022-01-20T02:48:44.333Z
If it is a generic nix problem, it shoudn't be here.  If nix is fine and the problem is with the `plutus-apps` package, then it might be relevant here is if it fits the [help/on-topic] on-topic criteria.
gRebel
<plutus-pioneer-program><nix><nix-shell>
nix-build not found inside nix-shell (Linux)
# nix-build not found inside nix-shell (Linux)

(Asked by: username_0 on 2022-01-15)

Every time I enter nix-shell, I need to execute the following command, otherwise nix-build and other nix-* commands are not found.
source /home/xxx/.nix-profile/etc/profile.d/nix.sh

I have added the following into file ~/.profile, but it does not seem to be working.
if [ -e /home/xxx/.nix-profile/etc/profile.d/nix.sh ]; then source /home/xxx/.nix-profile/etc/profile.d/nix.sh; fi # added by Nix installer

What's the reason for that? How can I get source /home/xxx/.nix-profile/etc/profile.d/nix.sh automatically when I run nix-shell?

**Tags:** plutus-pioneer-program, nix, nix-shell
> **Comments:**
> **username_1**: Welcome to Cardano SE! As a new user be sure to take the [Tour]. Also, this seems to be a nix question rather than a Cardano question and it should not be on this site if that is the case.  
> **username_2**: This is fairly odd and should not happen. `nix-shell` would know how to set your profile. So what you are saying is it works in your regular shell, but fails in `nix-shell`. Can you please provide more info around the context? What system do you run on, ...?  
> **username_3**: Yes, context information is going to be essential to find the problem here. Perhaps the shell is overwritting the PATH a bit too aggresively. If you have a link or a relevant snippet from the shell.nix, please share  
> **username_0**: Thanks @nrdxp! I'm running on Ubuntu, I run `shell.nix` from [plutus-apps](https://github.com/input-output-hk/plutus-apps/blob/main/shell.nix), should I change the this file somehow?  
> **username_0**: Hi @gRebel, I had this problem when I run `plutus-apps` for plutus pioneer program.  
> **username_1**: If it is a generic nix problem, it shoudn't be here.  If nix is fine and the problem is with the `plutus-apps` package, then it might be relevant here is if it fits the [help/on-topic] on-topic criteria.  

---

## 1 answers

### Answer by username_4 on 2022-01-16. Score: 0

I had trouble getting the plutus playground environment to run properly until I followed the directions in this link <https://docs.plutus-community.com/docs/setup/Ubuntu.html> and first did the uninstall at the bottom of the page and did the re-install (as explained on the same page from the link provided above) for multiple-user. The multi-user version is recommended on the actual Nix website. When I got to this line "Note If you will be working on the Plutus Pioneer Project, it will be necessary at this point to git checkout ... a specific commit to match the class materials. That commit hash is listed in the exercises week## directory in the cabal.project", I followed along with the tutorial listed below to compile the "English Auction" code from week01: <https://youtu.be/zPaDp4R9X7o?t=177> Your folders might vary from the instructors, so listen carefully to where you clone the repositories he mentions.

> **Comments:**
> **username_0**: Thanks! I'm aware of the specific commit for the repo, like I said everything works after I do `source /home/xxx/.nix-profile/etc/profile.d/nix.sh` each time entering `nix-shell`. I believe the path environment somehow is overwritten incorrectly after `nix-shell`, but don't know where to change it.  
> **username_5**: Perhaps related, I think I must have installed Nix twice, or a build or shell, still learning, but I think I created two different profile-link-1 and profile-link-2 in the directory /nix/var/nix/profiles/per-user/<username>.  When I do a `nix doctor --verbose` I was getting a multiple versions fail (https://cardano.stackexchange.com/questions/6648/nix-doctor-verbose-fail-multiple-versions-of-nix-found-in-path-on-macos-i7). Maybe someone smarter than me can help on how this happens, and if linked.  
> **username_6**: As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer).  

---

