I have the following convention for most of my projects:
/src
/Solution.sln
/SolutionFolder
/Project1
/Project2
/etc..
/lib
In order to change the path for projects using PackageReference instead of packages.config you need to use globalPackagesFolder
From https://docs.microsoft.com/en-us/nuget/reference/nuget-config-file
globalPackagesFolder (projects using PackageReference only)
The location of the default global packages folder. The default is %userprofile%.nuget\packages (Windows) or ~/.nuget/packages (Mac/Linux). A relative path can be used in project-specific nuget.config files. This setting is overridden by the NUGET_PACKAGES environment variable, which takes precedence.
repositoryPath (packages.config only)
The location in which to install NuGet packages instead of the default $(Solutiondir)/packages folder. A relative path can be used in project-specific nuget.config files. This setting is overridden by the NUGET_PACKAGES environment variable, which takes precedence.
I put Nuget.config next to my solution file and it worked.