Vanilla React on NixOS setup

Posted on January 25, 2020

Introduction

This post should provide a starting point to follow React’s introduction tutorial from my current NixOS enviroment.

Steps

  1. Create a shell.nix file with

    #######################################################
    ## Using this instead will use your current nix-channel
    # with import <nixpkgs> {};
    with import (fetchTarball https://releases.nixos.org/nixos/19.09/nixos-19.09.1936.e6391b4389e/nixexprs.tar.xz) { };
    #######################################################
    
    stdenv.mkDerivation {
      name = "react-bootstrap-shell";
      buildInputs = with pkgs; [
        nodePackages.create-react-app
        nodejs
        yarn
      ];
    }
  2. Run nix-shell --pure shell.nix

  3. Continue React’s introduction tutorial where you npx create-react-app my-app