How to use flakes with IFD?

I have some trouble with using flakes with import-from-derivation (like callCabal2nix). Building the resulting flake with nix build works fine, but if I try commands like nix flake show or nix flake check, it will try building the IFD on all the available platforms. Since my machine is only one platform, it fails.

Is there some standard solution to this issue?

Here is a repo that demonstrates this problem:


There is a workaround mentioned at, but it is a bit too hacky for my taste.