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-shell shebang won't work with withPackages #2072

Closed
teto opened this issue Apr 12, 2018 · 3 comments
Closed

nix-shell shebang won't work with withPackages #2072

teto opened this issue Apr 12, 2018 · 3 comments
Labels

Comments

@teto
Copy link
Member

teto commented Apr 12, 2018

This is really annoying, for instance this won't work

#! /usr/bin/env nix-shell 
#! nix-shell -p 'python.withPackages(ps:with ps;[secretstorage keyring ])' ~/nixpkgs -i sh

You get a
syntax error, unexpected $undefined, at (string):1:94

If you remove spaces on the 2nd line (works only if you have 1 package) than it works

#! /usr/bin/env nix-shell 
#! nix-shell -p python.withPackages(ps:[ps.keyring]) ~/nixpkgs -i sh

is fine

@copumpkin
Copy link
Member

That's it, we finally have conclusive proof that it was a bad idea for Nix to not use commas in its list syntax 😜

@S-NA
Copy link

S-NA commented Apr 12, 2018

This seems like the now closed #627, is this a regression or does the distinction between single and double quotes matter?

@peti peti added the bug label Apr 12, 2018
@edolstra
Copy link
Member

The problem is actually 'ps:with', which gets parsed as a URL. Try putting a space in between

nix-shell -p 'python.withPackages (ps: with ps; [secretstorage keyring ])'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants