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

flakes problems related to # and zsh #4686

Closed
timsears opened this issue Apr 2, 2021 · 4 comments
Closed

flakes problems related to # and zsh #4686

timsears opened this issue Apr 2, 2021 · 4 comments
Labels

Comments

@timsears
Copy link
Contributor

timsears commented Apr 2, 2021

nix flakes' # does not play nice with zsh when extendedGlob is enabled.

Here's a simple example...

> setopt extendedGlob                                                         
> nix profile install nixpkgs#hello            
Found existing alias for "nix". You should use: "n"
zsh: no matches found: nixpkgs#hello

Here's a workaround.

> unsetopt extendedGlob    
> nix profile install nixpkgs#hello  

...works

Any command that uses the # in the command is likely affected.

Many people will have extended glob enable automatically if they use zsh configuration frameworks such as oh-my-zsh.

Took a long time for me to realize this was a zsh issue more than a nix flakes issue. Might suggest that the resource path not include a # going forward.

This issue can be closed, but parking it here so people can find it when they search.

@timsears timsears added the bug label Apr 2, 2021
@Patryk27
Copy link
Member

Patryk27 commented Apr 4, 2021

As an easier workaround, wrapping in quotes or apostrophes - nix something 'nixpkgs#hello' - should work, too.

@stale
Copy link

stale bot commented Oct 2, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the stale label Oct 2, 2021
@socksy
Copy link

socksy commented Jan 3, 2022

Another work around is to add:

alias nix="noglob nix"

in your .zshrc

@stale stale bot removed the stale label Jan 3, 2022
@otavio
Copy link

otavio commented Jan 3, 2022

Another work around is to add:

alias nix="noglob nix"

in your .zshrc

This couldn't be done automatically?

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

4 participants