

Unless your system is very weird that’ll be the nixpkgs repo, but again, this is only relevant as a fallback. import imports the default.nix of whatever your nixpkgs channel is.Basically, we’re cargo culting this because others do it this way. I think technically this isn’t necessary at all, though it can come in handy if you ever want to import your shell. The ? means “if this argument is not defined, set it to”.I mix in some funny syntax, too, let me explain So, we make it explicit that our shell.nix is a function and takes the pkgs argument. Without it there are no packages, and even mkShell hasn’t been defined yet! We need that pkgs argument if we want to install packages - it maps back to. Nix-shell will either take a simple expression like yours or it will take a function like this one and give it a pkgs argument, which refers to the channel of your system. Shell.nix is a nix file, which the nix-shell command will evaluate, and then use to create your environment. Ah, heh, ok, so the full file contents should be something like: :Įxport PATH="$PWD/node_modules/.bin/:$PATH"Įxport NPM_PACKAGES="$HOME/.npm-packages"
