Nix-build error: "Cannot copy ./. to .: destination already exists!"

I have a pretty basic setup where my frontend is made with Vite.
Now, I want to introduce Nix for running CI commands like nix-shell --run "npm test"

When I try to build with nix-build, I receive the following error:

error: builder for '/nix/store/j2z762j11km1yx2p19xyghwjdjq84azz-frontend.drv' failed with exit code 1;
       last 5 log lines:
       > Running phase: unpackPhase
       > unpacking source archive ./.
       > Cannot copy ./. to .: destination already exists!
       > Did you specify two "srcs" with the same "name"?
       > do not know how to unpack source archive ./.

Here is my default.nix:

    nixpkgs = import (fetchTarball("")) {};
with nixpkgs;

stdenv.mkDerivation {
    name = "frontend";
    src = "./.";
    buildInputs = [
    installPhase = ''
        echo "===> 1/1 Installing packages"
        npm i
        echo "===> 1/1 Packages installed"

I don’t understand why it cannot copy… Can someone help me out?

Thanks in advance!


My configuration file had a typo: src should not use ".