Can't set `nixFlakes` as `nix.package`

I’m trying to install the unstable nix package with flakes experimental support, i followed the wiki editing my configuration.nix with these lines:

  nix = {
    package = pkgs.nixFlakes;
    extraOptions = ''
      experimental-features = nix-command flakes
    trustedUsers = [

What causes the problem is the nixFlakes package, when I try to implement my edits with nixos-shell test I get:

building the system configuration...
nix-build: src/libfetchers/ nix::fetchers::DownloadFileResult nix::fetchers::downloadFile(nix::ref<nix::Store>, const string&, const string&, bool, const Headers&): Assertion `request.expectedETag == res.etag' failed.

I remember that I installed that package some months ago, but since I had no time then I commented it out and now I can’t reinstall it.

I don’t think that can help but this is my entire (messy and not too updated) NixOS (nixos-20.09 channel) configuration.

Thank you

This is a recent bug triggered by GitHub change or something

Is there any temporary workaround?

The workaround is in the issue:

BTW: You only have to delete ~/.cache/nix/fetcher-cache-v1.sqlite & ~/.cache/nix/fetcher-cache-v1.sqlite-journal.

I’ve already read it and tried but the error persists.

Edit: mea culpa, I deleted the main user’s cache but was running nixos-rebuild using sudo.
Thank you!