How can I dump my nixos config which eventually works?

Hi, I’m tring to dump my nixos config to confirm whether it is configured as expect.

I have tried to use nix repl to print out specific attributes like following

$ nix repl
> :lf /path/to/flake.nix
> nixosConfigurations.nixos.config.services.xserver.videoDrivers
> :p nixosConfigurations.nixos.config

But this solution is far from perfect:

  1. If I want to see the whole config like :p nixosConfigurations.nixos.config then many errors will occur.
  2. It is not possible to see the eventually working config which merged with default value.

So, is there any better way?