How to use a .gz download url as flake input

It seems like flakes input url only supports a few extensions as noted here:

https://nixos.org/manual/nix/unstable/command-ref/new-cli/nix3-flake.html#types

In URL form, the schema must be http://, https:// or file:// URLs and the extension must be .zip, .tar, .tar.gz, .tar.xz, .tar.bz2 or .tar.zst.

Is there a workaround or should i move my input inside output and use fetchUrl with a sha256 option

bare gz can only include a single file, using that as a flake input doesn’t make much sense as it can not carry the flakes lock file.

The gz file is actually just a binary so it’s non flake input

Then do not use it as an input but a “traditional” fetcher.

Thanks that’s what I have ended up doing but I do lose the ability to use the lock file to record the sha.
I find it interesting that flakes can have inputs specified in the output via fetchUrl and others like that.
What’s the reason all those things are allowed and not forced to be provided in inputs.
Is it just a backwards compatibility thing.

Objection: I guess the end game of flakes is to disable “classic” fetchers.

But you could use { flake = false; } and decompress the content yourself right at the top of your flake as a sort of compatibility layer in case flakes do not yet unpack gz inputs.