The nixos-generate-config script adds <nixpkgs/nixos/modules/installer/scan/not-detected.nix> to the imports list in hardware-configuration.nix. That file (not-detected.nix) seems to merely set the default for hardware.enableRedistributableFirmware and according to its history, never did more than that.
Is there a reason for this strange extra indirection?
I.e. why not just write hardware.enableRedistributableFirmware = lib.mkDefault true; directly into hardware-configuration.nix as its done with the other options?
I’d guess it’s so that more things can be done for undetected systems in the future without regenerating hardware-configuration.nix. The rest of hardware-configuration.nix is literally specific to your hardware, and so would never be able to benefit from such a thing.
That’s fair. Just two ways of doing the same thing. I guess the current way could technically be a little faster, since it means systems that don’t use not-detected.nix don’t have to load the file and load its options.