How to debbug nixos-rebuild

I am currently running into a very annoying issue with my nixos setup, I can’t rebuild it because of
an error with the current message

while evaluating 'fixupOptionType' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:730:26, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:464:23:
while evaluating the attribute 'type.getSubModules' at /nix/store/b540q6yrhghmqpddb7irkqnx019zapab-source/integration-common.nix:87:7:
undefined variable 'raw' at /nix/store/b540q6yrhghmqpddb7irkqnx019zapab-source/integration-common.nix:87:33

What is this varaible called ‘raw’? Is this a conflict? How may I troubleshoot this? I don’t record myself changing nothing related to this variable or path.

afaict, your problem is here, in home-manager:

types.raw was added to nixpkgs in Merge pull request #160489 from Infinisil/types.raw · NixOS/nixpkgs@6225804 · GitHub, well before the nixos 22.05 release. what version of nixpkgs are you using? i.e. what does nixos-version print?