0

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

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.

1 Answer 1

1

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.

4
  • 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
    Feb 27 at 23:52
  • 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.
    – omegafer
    Feb 28 at 5:03
  • 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
    Feb 28 at 7:16
  • 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.
    – omegafer
    Feb 28 at 12:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.