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

It's unclear what nix eval --arg and --argstr do #7076

Open
2 tasks done
lf- opened this issue Sep 21, 2022 · 1 comment
Open
2 tasks done

It's unclear what nix eval --arg and --argstr do #7076

lf- opened this issue Sep 21, 2022 · 1 comment

Comments

@lf-
Copy link
Member

lf- commented Sep 21, 2022

Problem

I want to run builtins.compareVersions from the command line with argument strings. However, I can't figure out how to actually do that.

I've tried nix eval --raw --argstr a 1.23 --argstr b 1.24 --expr '{a, b}: builtins.compareVersions a b', which returns this:

nix eval --raw --argstr a 1.23 --argstr b 1.24 --expr '{a, b}: builtins.compareVersions a b'
error: cannot coerce a function to a string

--apply seems promising but it maps over the installable paths, which is not really what I want. I just want to call a nix function with arguments from the shell. It's unclear to me what --argstr actually does given this.

Checklist

Proposal

Figure out and clarify what --argstr actually does with nix eval.

@lf- lf- changed the title It's unclear how to use nix eval with functions It's unclear what nix eval --arg and --argstr do Sep 21, 2022
@bryanhonof
Copy link
Member

Sounds similar to #2678.

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

No branches or pull requests

2 participants