-
-
Notifications
You must be signed in to change notification settings - Fork 15.5k
use newer clj2nix which passes pkgs as an argument to deps.nix #50270
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
Conversation
@@ -118,7 +118,7 @@ let # packageJSON=./package.json; | |||
''; | |||
|
|||
|
|||
cljdeps = import ./deps.nix; | |||
cljdeps = import ./deps.nix pkgs; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this file automatically generated?
@@ -1,13 +1,15 @@ | |||
# generated by clj2nix | |||
let repos = [ | |||
{ pkgs, ... }: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's most common to use { pkgs ? import <nixpkgs> {} }:
for such autogenerated files, because then they can be used like import ./foo.nix {}
but also pass an argument explicitly with import ./foo.nix { pkgs = ...; }
. And we usually don't use ...
because those extra arguments get ignored.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I originally said to use just pkgs:
and import ./foo.nix pkgs
here because we'd know that this fix is just temporary. I'm suggesting above for it making clj2nix the most usable in general :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, l hope this looks about right now?
@Mic92 yes here https://github.com/hlolli/clj2nix @infinisil thanks for the pro tip! I will change it and squash my PR. |
@@ -1,13 +1,15 @@ | |||
# generated by clj2nix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion for clj2nix
: I would also include a version number in the generated files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for this catch, it's now implemented!
b9c69fe
to
040c144
Compare
One minor thing: Can you change the commit message to have the |
…instead of import <pkgs>
040c144
to
e6ed52e
Compare
@infinisil done ! |
Do not refer to <nixpkgs> as it will produce the following message: "evaluation aborted with the following error message: 'Illegal use of <nixpkgs> in Nixpkgs.'"
Motivation for this change
@cocreature reported
Things done
I changed how clj2nix exports the nix expression and from now on it wont import like this, instead an argument needs to be passed to the import statement.
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)ping @infinisil