Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nix-prefetch fails on nur-packages. error: Could not find Nixpkgs path: /tmp/nur-packages/pkgs/top-level #49

Open
milahu opened this issue Sep 28, 2023 · 0 comments

Comments

@milahu
Copy link

milahu commented Sep 28, 2023

nix-prefetch fails on nur-packages

error: Could not find Nixpkgs path: /tmp/nur-packages/pkgs/top-level

to reproduce

cd /tmp
git clone https://github.com/milahu/nur-packages
cd nur-packages
git checkout 670a6637e9488bbd2f8bc00e3c8dc58a9fe1f1bc
./pkgs/tools/archivers/sevenzip/update.sh

update.sh fails at

NEW_FREE_HASH=$(nix-prefetch -f "$NIXPKGS_ROOT" -E "$attr_path.src" --url "$URL")

which evals to

nix-prefetch -f /tmp/nur-packages -E sevenzip.src --url https://7-zip.org/a/7z2200-src.tar.xz

ideally, nix-prefetch should not rely on the internal structure of nixpkgs (pkgs/top-level)
and only use default.nix or flake.nix as entry point

just like nix-build

nix-build /tmp/nur-packages -A sevenzip

workaround:

- nix-prefetch -f "$NIXPKGS_ROOT" -E "$attr_path.src" --url "$URL"
+ nix-prefetch -f "<nixpkgs>" -E "(import $NIXPKGS_ROOT {}).$attr_path.src" --url "$URL"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant