-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
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 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") - 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.
