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: https://github.com/anka-213/cclaw-nix-stuff/tree/nix-flakes

5 Likes

There is a workaround mentioned at https://github.com/NixOS/nix/issues/4265#issuecomment-732358327, but it is a bit too hacky for my taste.

2 Likes