Describe the bug
The documentation states that fetchTarball requires the file to be tar file. Apparently that isn't entirely true and Nix happily consumes other files.

Steps To Reproduce
- Open a
nix repl and paste nix-repl> builtins.readDir (builtins.fetchTarball "https://releases.nixos.org/nixos/24.05-small/nixos-24.05beta551.6d452319127a/nixos-minimal-24.05beta551.6d452319127a-x86_64-linux.iso")
- See that Nix happily downloaded the entire ISO and unpacked it into your store.
Expected behavior
It should fail to unpack the archive..
From the libarchive.org page it seems like the following formats are supported: tar, pax, cpio, zip, xar, lha, ar, cab, mtree, rar, and ISO images. I chose the iso test by random and that succeeded.
nix-env --version output
Additional context
I was trying to figure out what has to be supported to be feature compatible with fetchTarball while working on npins. My objective was to get rid of calling nix-prefetch-url as a subprocess in order to ship the program as a single statically linked binary..
Priorities
Add 👍 to issues you find important.
Describe the bug
The documentation states that
fetchTarballrequires the file to betarfile. Apparently that isn't entirely true and Nix happily consumes other files.Steps To Reproduce
nix repland pastenix-repl> builtins.readDir (builtins.fetchTarball "https://releases.nixos.org/nixos/24.05-small/nixos-24.05beta551.6d452319127a/nixos-minimal-24.05beta551.6d452319127a-x86_64-linux.iso")Expected behavior
It should fail to unpack the archive..
From the
libarchive.orgpage it seems like the following formats are supported: tar, pax, cpio, zip, xar, lha, ar, cab, mtree, rar, and ISO images. I chose theisotest by random and that succeeded.nix-env --versionoutputAdditional context
I was trying to figure out what has to be supported to be feature compatible with
fetchTarballwhile working onnpins. My objective was to get rid of callingnix-prefetch-urlas a subprocess in order to ship the program as a single statically linked binary..Priorities
Add 👍 to issues you find important.