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

Cannot pass lists #1

Closed
ajs124 opened this issue Mar 19, 2019 · 5 comments
Closed

Cannot pass lists #1

ajs124 opened this issue Mar 19, 2019 · 5 comments

Comments

@ajs124
Copy link

ajs124 commented Mar 19, 2019

Some fetchers (like fetchrepoproject) take lists, which I cannot seem to figure out how to pass to nix-prefetch.

Using --input nix or --input json fails with jq errors, regular command line arguments seem to turn the list into a string.

I tried some more things, but I doubt they are relevant. I would love to be able to use nix-prefetch, but without being able to pass lists to it somehow, it sadly does not fulfill my requirements.

@msteen
Copy link
Owner

msteen commented Mar 20, 2019

Thank you for reporting this! I indeed made --input unnecessarily restrictive in that it only allows string arguments, considering how passing arguments via the command line does allow arbitrary expressions via e.g. --<name> --expr '[ 1 2 ]'. I have modified the implementation of --input for nix (now even allows an arbitrary Nix expression resulting in an attribute set of fetcher arguments) and json, which I will publish once I have done some more testing. So you can either wait for that push or workaround it for now with --<name> --expr '[ 1 2 ]'.

@ajs124
Copy link
Author

ajs124 commented Mar 20, 2019

Thanks for looking into this! (and writing nix-prefetch in the first place)

Using --input was already my workaround, because I hadn't figured out that --expr can be used this way.

msteen added a commit that referenced this issue Mar 22, 2019
@msteen
Copy link
Owner

msteen commented Mar 22, 2019

I just pushed the necessary fixes. Could you verify if it now works like you expected it to? Then I can tag it as the new version. My goal for nix-prefetch is to have it cover all prefetching needs for Nix packages, so let me know if there are still other things withholding you from using it for your use case. Also if you have any ideas on how to improve it, any feedback is most welcome.

@ajs124
Copy link
Author

ajs124 commented Mar 22, 2019

Yep, seems to work. Although I just now figured out that apparently the declarative hydra configuration does not take JSON lists. Oh well…

Another issue I've run into is this: error: getting status of '/run/user/1000/nix-prefetch/prelude.nix': No such file or directory.
This error seems to appear when running nix-prefetch in an environment where <nixpkgs> refers to something pre 19.03. I have a workaround for that, though.

@msteen
Copy link
Owner

msteen commented Mar 23, 2019

Great to hear its working for you. About the other issue, I created #2 and think I have found the cause. It likely has to do with nixpkgs-overlays on NIX_PATH rather than nixpkgs, but I will let you know when I pushed the fix. I will be closing this issue now, since list passing issue should be fixed now.

@msteen msteen closed this as completed Mar 23, 2019
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

2 participants