source common.sh clearStore cd "$TEST_ROOT" test_fetch_file () { echo foo > test_input input_hash="$(nix hash path test_input)" nix eval --impure --file - < inputs/test_input_file tar cfa test_input.tar.gz inputs cp test_input.tar.gz test_input_no_ext input_tarball_hash="$(nix hash path test_input.tar.gz)" input_directory_hash="$(nix hash path inputs)" cat < flake.nix { inputs.no_ext_default_no_unpack = { url = "file://$PWD/test_input_no_ext"; flake = false; }; inputs.no_ext_explicit_unpack = { url = "tarball+file://$PWD/test_input_no_ext"; flake = false; }; inputs.tarball_default_unpack = { url = "file://$PWD/test_input.tar.gz"; flake = false; }; inputs.tarball_explicit_no_unpack = { url = "file+file://$PWD/test_input.tar.gz"; flake = false; }; outputs = { ... }: {}; } EOF nix flake update nix eval --file - < flake.nix { inputs.tarball = { url = "file://$PWD/test_input.tar.gz"; flake = false; }; outputs = { self, tarball }: { foo = builtins.readFile "${tarball}/test_input_file"; }; } nix flake update clearStore "$NIX_DAEMON_PACKAGE/bin/nix" eval .#foo EOF } test_fetch_file test_file_flake_input