Describe the bug
When specifying a flake input that's a tarball or zip, Nix complains that the archive contains an unexpected number of top-level files if the archive contains more than 1 top-level directory.
This seems to have been brought up before in this discourse thread back in February. The root cause is from the fetchTarball fetcher; in particular this section. I'm not sure what the rationale is for expecting only 1 top-level directory, but in the context of flake inputs, it can be quite a blocker when fetching archives from other parties as we cannot control how they're structured.
Steps To Reproduce
Example flake input:
catppuccin-gtk-macchiato = {
url = "https://github.com/catppuccin/gtk/raw/fc336313a84e0d7ec1a3499047fb1e73eef8a005/Releases/Catppuccin-Macchiato.zip";
flake = false;
};
When attempting to build, the following error is shown:
error: tarball 'https://github.com/catppuccin/gtk/raw/fc336313a84e0d7ec1a3499047fb1e73eef8a005/Releases/Catppuccin-Macchiato.zip' contains an unexpected number of top-level files
Expected behavior
The tarball / zip should be extracted without any errors.
nix-env --version output
nix-env (Nix) 2.11.0
Describe the bug
When specifying a flake input that's a tarball or zip, Nix complains that the archive
contains an unexpected number of top-level filesif the archive contains more than 1 top-level directory.This seems to have been brought up before in this discourse thread back in February. The root cause is from the
fetchTarballfetcher; in particular this section. I'm not sure what the rationale is for expecting only 1 top-level directory, but in the context of flake inputs, it can be quite a blocker when fetching archives from other parties as we cannot control how they're structured.Steps To Reproduce
Example flake input:
When attempting to build, the following error is shown:
error: tarball 'https://github.com/catppuccin/gtk/raw/fc336313a84e0d7ec1a3499047fb1e73eef8a005/Releases/Catppuccin-Macchiato.zip' contains an unexpected number of top-level filesExpected behavior
The tarball / zip should be extracted without any errors.
nix-env --versionoutputnix-env (Nix) 2.11.0