Use overlays in Repl nix config


I would like to use this Rust overlay: GitHub - oxalica/rust-overlay: Pure and reproducible nix overlay of binary distributed rust toolchains

But I can’t make it work. It seems that a Repl doesn’t support overlays. Am I wrong?

I also tried this overlay: GitHub - mozilla/nixpkgs-mozilla: Mozilla overlay for Nixpkgs.

And specifically this code in shell.nix:

  moz_overlay = import (builtins.fetchTarball;
  nixpkgs = import <nixpkgs> { overlays = [ moz_overlay ]; };
  with nixpkgs;
  stdenv.mkDerivation {
    name = "moz_overlay_shell";
    buildInputs = [
      # to use the latest nightly:
      # to use a specific nighly:
      (nixpkgs.rustChannelOf { date = "2018-04-11"; channel = "nightly"; }).rust
      # to use the project's rust-toolchain file:
      (nixpkgs.rustChannelOf { rustToolchain = ./rust-toolchain; }).rust

But I get this error:

nix error: building nix env: exit status 1
evaluating file '/nix/store/nzp4m3cmm7wawk031byh8jg4cdzjq212-nix-2.3.16/share/nix/corepkgs/derivation.nix'
evaluating file '/home/runner/MultiversX-SC-Development/shell.nix'
evaluating file '/home/runner/.nix-defexpr/channels/nixpkgs-unstable'
error: anonymous function at /nix/store/pdq4jajdm4cx5dxmcwknhz8i5amynigy-nixpkgs-unstable/nixpkgs-unstable/default.nix:1:1 called with unexpected argument 'overlays', at /home/runner/MultiversX-SC-Development/shell.nix:3:13

Any idea why?