You should consider moving texlive to its own nix shell. As described here, it's better practice to separate the development environments from the system configuration. Additionally, the python311Packages.pygments part will not work unless it is done in a nix shell, preferrably through python311.withPackages. Here is a simple implementation, not using flakes: