<p>Once inside the nix-shell, it assumes that the correct dependencies have already been loaded especially if you have built it on top of the newly cloned plutus-apps repo.  The nix files necessary are therefore already available for any new project that you would compile or run inside the nix shell.</p>
<p>In the Plutus Pioneer Program, there is an instruction to have to update (checkout) to the proper github commit tag of the plutus-apps repo that the current week's source codes is using.  Follow this intruction, then enter the nix shell.  Once inside the nix shell, you will be able to successfully compile and run the projects of the current week.</p>
<p>For a new project to work, there is an option to set a file as an executable in the cabal project file.  You may want to watch a part of the Plutus Pioneer Program - Iteration #3 Week #4 Lecture #2 video.  At time 09:55, Lars made an example on how to execute his source code using <code>cabal run</code> command, and he also explained afterwards the needed changes in the cabal project file if you want to use that command.</p>

CC BY-SA 4.0
2022-02-27T23:52:55.913Z
Thanks for the answer but i think it is answering the wrong question. The question is can I generate these files into a separate folder from a terminal command to upload them to GitHub along with my code for a new project.
KryptoKing
CC BY-SA 4.0
2022-02-28T05:03:06.680Z
@KryptoKing Okay, I was assuming that the files you want to generate are files of the nix shell, which in my opinion don't have to be specified as part of your new code, and therefore no need to include in Github upload.  I am not an expert in nix OS or shell, so I guess later somebody else knowledgeable might shed light about your intended result for your project.
omegafer
CC BY-SA 4.0
2022-02-28T07:16:13.063Z
Thanks for the help. I appreciate you trying to help me out. Can I ask why you don't believe they belong in the repo? Arnt they required to reproduce the effective env?
KryptoKing
CC BY-SA 4.0
2022-02-28T12:25:52.683Z
In Lars' lectures, we only clone the source files. I believe there are no nix files in his source repo.
I didn't encounter problems loading the PPP source files while inside the `nix-shell`,
and it successfully compiles and run. The `nix-shell` already managed the environment by referencing
the right plutus-apps and cabal files, thus, with the correct environment, you only need to clone
the source codes (and the cabal project file), no nix files needed just like what Lars did in his repo.
omegafer
CC BY-SA 4.0
2022-02-27T12:27:49.163Z
2022-02-27T18:19:13.340Z
2022-02-27T18:19:13.340Z
omegafer
<p>I built the plutus-apps repo from iohk, and then made a different folder to orgenise my projects. I want to know how to have the nix files needed to make the environment generated in the new project folder and the same with the cabal files.</p>
<p>I have used <code>cabal init</code> but get the following output:</p>
<p><a href="https://i.sstatic.net/OnrkM.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/OnrkM.png" alt="Cabal init output" /></a></p>
<p>I don't really understand what this means nor can I figure out how to generate the files needed for <code>nix-shell</code> to work in this project.</p>
<p>Please help me figure out how to do this.
Thankyou.</p>

<plutus-pioneer-program><cabal><nix><nix-shell><nixos>
How Do you generate the Cabal and Nix files for a new project?
# How Do you generate the Cabal and Nix files for a new project?

(Asked by: username_0 on 2022-02-22)

I built the plutus-apps repo from iohk, and then made a different folder to orgenise my projects. I want to know how to have the nix files needed to make the environment generated in the new project folder and the same with the cabal files.

I have used `cabal init` but get the following output:

[![Cabal init output](https://i.sstatic.net/OnrkM.png)](https://i.sstatic.net/OnrkM.png)

I don't really understand what this means nor can I figure out how to generate the files needed for `nix-shell` to work in this project.

Please help me figure out how to do this.
Thankyou.

**Tags:** plutus-pioneer-program, cabal, nix, nix-shell, nixos

---

## 1 answers

### Answer by username_1 on 2022-02-27. Score: 1 | Accepted answer

Once inside the nix-shell, it assumes that the correct dependencies have already been loaded especially if you have built it on top of the newly cloned plutus-apps repo. The nix files necessary are therefore already available for any new project that you would compile or run inside the nix shell.

In the Plutus Pioneer Program, there is an instruction to have to update (checkout) to the proper github commit tag of the plutus-apps repo that the current week's source codes is using. Follow this intruction, then enter the nix shell. Once inside the nix shell, you will be able to successfully compile and run the projects of the current week.

For a new project to work, there is an option to set a file as an executable in the cabal project file. You may want to watch a part of the Plutus Pioneer Program - Iteration #3 Week #4 Lecture #2 video. At time 09:55, Lars made an example on how to execute his source code using `cabal run` command, and he also explained afterwards the needed changes in the cabal project file if you want to use that command.

> **Comments:**
> **username_0**: Thanks for the answer but i think it is answering the wrong question. The question is can I generate these files into a separate folder from a terminal command to upload them to GitHub along with my code for a new project.  
> **username_1**: @KryptoKing Okay, I was assuming that the files you want to generate are files of the nix shell, which in my opinion don't have to be specified as part of your new code, and therefore no need to include in Github upload.  I am not an expert in nix OS or shell, so I guess later somebody else knowledgeable might shed light about your intended result for your project.  
> **username_0**: Thanks for the help. I appreciate you trying to help me out. Can I ask why you don't believe they belong in the repo? Arnt they required to reproduce the effective env?  
> **username_1**: In Lars' lectures, we only clone the source files. I believe there are no nix files in his source repo. I didn't encounter problems loading the PPP source files while inside the `nix-shell`, and it successfully compiles and run. The `nix-shell` already managed the environment by referencing the right plutus-apps and cabal files, thus, with the correct environment, you only need to clone the source codes (and the cabal project file), no nix files needed just like what Lars did in his repo.  

---

