Default version of replit.nix

I have found my own solution to my question found here:-

in response to:-

And in reply to @Firepup650

I simply created a new repl.
I zipped up the existing one and downloaded it.
I reloaded into the new repl, in a new folder.
I deleted unwanted files and slightly reworked the .replit file to reflect the new hierarchy and call into the file I have to test working.

However, the original edited replit.nix is this:-

{ pkgs }: {
  deps = [
    pkgs.python39Packages.pip
    pkgs.sudo
    pkgs.source venv/bin/activate
    pkgs.toybox
    pkgs.telnet
    pkgs.busybox
    pkgs.netcat-gnu
    pkgs.python310Full
    pkgs.replitPackages.stderred
  ];
  env = {
    PYTHON_LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [
      # Needed for pandas / numpy
      pkgs.stdenv.cc.cc.lib
      pkgs.zlib
      # Needed for pygame
      pkgs.glib
      # Needed for matplotlib
      pkgs.xorg.libX11
    ];
    PYTHONHOME = "${pkgs.python310Full}";
    PYTHONBIN = "${pkgs.python310Full}/bin/python3.10";
    LANG = "en_US.UTF-8";
    STDERREDBIN = "${pkgs.replitPackages.stderred}/bin/stderred";
  };
}

It would be interesting to understand the differences and why this configuration fails.

I should also add that it seems the original configuration file kept on having packages added to, eg telnet.
I was calling telnet at the command line and receiving the error:-
error: ‘telnet’ has been renamed to/replaced by ‘inetutils’

Using Ghostwriter it suggested:-
sudo apt-get update
sudo apt-get install inetutils-telnet


However, this happened repeatedly, each time it seems a line being added to the replit.nix file (which I then removed).

The line “sudo apt-get install inetutils-telnet”
also return an output telling me that the package is present from several available sources, giving a choice of which to use.
The line appended to replit.nix reflected that choice.

you can’t really use sudo because it needs root access which replit denies to prevent command line injections since their code is run on a VM

1 Like

Yes, Ghostwriter seems to understand the environment less than I do.

Never mind, it is still useful for many things.
It just needs to be treated with some caution, which is a bit of a learning curve in itself.

replace with

pkgs.inetutils

(This is what that replaced message meant)

This shouldn’t be here, we can’t use sudo anyways.

Remove this line. (You can’t do this in this file AFAIK)


After making these changes, please provide any new errors Nix returns.

2 Likes

OK, thanks for this.
‘replaced’ OK got it.

No sudo - got it.

Very useful.

@QwertyQwerty88 please mark firepup’s as solved

4 Likes

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