Skip to main content

Getting Started With Nix

Warning: Nix support on Replit is still under heavy development and is subject to change.

The best way to get started with Nix on Replit is to fork one of the existing templates:

Once you have forked one of the templates, there are 2 config files that you can use to customize the environment:

  • replit.nix - Configures the nix environment

This file should look something like the example below. The deps array specifies which Nix packages you would like to be available in your environment. You can search for Nix packages here:

{ pkgs }: {
deps = [
  • .replit - Configures the run command

The run command in this file should look something like this. You can use any binary made available by your replit.nix file in this run command.

run = "cowsay Welcome to nix on Replit!"

Once both those files are configured and you add files for your language, you can run you repl like normal, with the run button.

Both the Console and Shell will pick up changes made to your replit.nix file. However, once you open the Shell tab, the environment will not update until you run exit. This will close out the existing shell process and start a new one that includes any changes that you made to your replit.nix file.

Learn More About Nix‚Äč

If you'd like to learn more about Nix, here are some great resources: