I am getting this every time I run the program

Question:
How do I get rid of this text that appears in the console when I run the program?

nix error: building nix env: exit status 1
Output has been trimmed to the last 20 lines
evaluating file '/home/runner/Practice-2/replit.nix'
error:
       … while calling the 'derivationStrict' builtin

         at /builtin/derivation.nix:9:12: (source not available)

       … while evaluating derivation 'nix-shell'
         whose name attribute is located at /nix/store/4va5hjb3sdk8pnpn3dsnkdg65fw28jgv-nixpkgs-23.05-src/pkgs/stdenv/generic/make-derivation.nix:303:7

       … while evaluating attribute 'buildInputs' of derivation 'nix-shell'

         at /nix/store/4va5hjb3sdk8pnpn3dsnkdg65fw28jgv-nixpkgs-23.05-src/pkgs/stdenv/generic/make-derivation.nix:350:7:

          349|       depsHostHost                = lib.elemAt (lib.elemAt dependencies 1) 0;
          350|       buildInputs                 = lib.elemAt (lib.elemAt dependencies 1) 1;
             |       ^
          351|       depsTargetTarget            = lib.elemAt (lib.elemAt dependencies 2) 0;

       error: Dependency is not of a valid type: element 1 of buildInputs for nix-shell

The program still works though.

Repl link/Link to where the bug appears:
https://replit.com/@Hadl4/Practice-2

Try deleting replit.nix. Your repl uses the new version of the .replit file which includes the nix information. I forked it and deleting replit.nix worked for me.

You'll have to show hidden files to find it, click here to see how

image
Simply click the 3 dots then “Show hidden files”. :slight_smile:

4 Likes

@Hadl4 Welcome to the forums!
In your replit.nix file, change it from:

{ pkgs }: {
  deps = [
    pkgs.1
  ];
}

to:

{ pkgs }: {
  deps = [
  ];
}

Here, we removed the unnecessary nix package that you don’t need (it should be empty).
Hope this helps!

3 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.