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

Can't use + in inputs.*.url in flake.nix #6688

Open
SnO2WMaN opened this issue Jun 19, 2022 · 3 comments
Open

Can't use + in inputs.*.url in flake.nix #6688

SnO2WMaN opened this issue Jun 19, 2022 · 3 comments
Labels

Comments

@SnO2WMaN
Copy link

Describe the bug

Some GitHub repositories (not specifically related to Nix) have releases with tags like 0.3.0+plus, for example, which I can specify in flake.nix as inputs.foo.url = github:foo/bar/0.3.0+plus but cannot get or lock.
Likewise it will fail if + is replaced by %2B.

Expected behavior

Can fetch and lock.

nix-env --version output

nix-env (Nix) 2.8.1

@SnO2WMaN SnO2WMaN added the bug label Jun 19, 2022
@tomberek
Copy link
Contributor

Potentially add a + to https://github.com/NixOS/nix/blob/master/src/libutil/url-parts.hh#L26
But this does mean the URL is no longer a valid URL. Might be preferable to ensure + is percent encoded/decoded.

A workaround for now is to use the attribute syntax (not available in CLI):

{
  inputs.s = {
    type = "github";
    owner = "tomberek";
    repo = "nix";
    ref = "tag+tag";
  };
  outputs = _: _.s;
}

@SuperSandro2000
Copy link
Member

Does quoting make a difference here?

@tgunnoe
Copy link

tgunnoe commented Aug 18, 2022

Does quoting make a difference here?

No, I just tried with quotes in the non-cli schema. looks like any special characters in the URL will be fail to retrieve the proper commit.

tstat added a commit to adminy/raspberry-pi-nix that referenced this issue Jun 24, 2024
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