This reverts most of 89e98378, as those references are sanitized now. Fixes #10039, at least most of it. The `sane` case wasn't fixed, as it calls a *function* in pkgs to get the default value.