Ok this is an issue with Nix then. This is best reported in the GitHub - NixOS/nix: Nix, the purely functional package manager repo. Or try the nix from master, it contains a bunch of fixes that haven’t been published yet.
{ pkgs, ... }:
{
nix.package = pkgs.nixUnstable.overrideAttrs(x: {
name = "nix-master";
src = builtins.fetchGit { url = "https://github.com/NixOS/nix.git"; rev = "master"; };
});
}