Amdgpu-pro error when attempting to display linuxPackages in nix repl

I am trying to view the available kernels by running:

nix repl
:l <nixpkgs>

according to the wiki Linux kernel - NixOS Wiki. However, this results in several errors relating to ati_drivers_x11, hid-nintendo, and sch_cake. I was previously getting errors related to unfree and broken packages, and I had to create the file ~/.config/nixpkgs/config.nix and add:

  allowUnfree = true;
  allowBroken = true;
  nvidia.acceptLicense = true;

to it. I am wondering if I also need to add info about my hardware to this directory? Maybe copy /etc/nixos/hardware-configuration.nix to it?

I am also wondering why these variables were being sourced from ~/.config/nixpkgs/config.nix and not /etc/nixos/configuration.nix, which already had them set properly.

Any help would be much appreciated.