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

Unable to update urls containing whitespace #76

Closed
michaeladler opened this issue May 2, 2023 · 1 comment
Closed

Unable to update urls containing whitespace #76

michaeladler opened this issue May 2, 2023 · 1 comment

Comments

@michaeladler
Copy link

If the url contains a url-encoded whitespace (e.g. %20), then update-nix-fetchgit fails because the call to nix-prefetch-url fails. For example, try to update this expression:

fetchurl {
  url = "https://github.com/ryanoasis/nerd-fonts/raw/v2.3.3/patched-fonts/Gohu/uni-11/complete/GohuFont%20Nerd%20Font%20Complete%20Mono.ttf";
  sha256 = "908211409b247f82a79c1554a533723914073a6d4957fd727a705f4d8d2417b9";
}

This fails with the following error:

Error: nix-prefetch-url failed with exit code 1 and error output:
error: store path '0qghqxvlib3lsqbdbdfma150pf47y37p-GohuFont%20Nerd%20Font%20Complete%20Mono.ttf' contains illegal character '%'

Indeed, nix-prefetch-url 'https://github.com/ryanoasis/nerd-fonts/raw/v2.3.3/patched-fonts/Gohu/uni-11/complete/GohuFont%20Nerd%20Font%20Complete%20Mono.ttf' produces the above error.

The solution is to specify the --name argument, e.g. this works:

nix-prefetch-url --name gohufont 'https://github.com/ryanoasis/nerd-fonts/raw/v2.3.3/patched-fonts/Gohu/uni-11/complete/GohuFont%20Nerd%20Font%20Complete%20Mono.ttf'

See NixOS/nix#6116

@michaeladler
Copy link
Author

Just noticed this is a duplicate of #74 (although the title wasn't obvious to me)

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