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
check-meta.nix: Fix message for nix build
users as well
#101367
check-meta.nix: Fix message for nix build
users as well
#101367
Conversation
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/why-isnt-config-nixpkgs-config-nix-evaluated-for-nix-build/9579/4 |
Isn't this more about flake than unstable? As for me it works using non-flake syntax, though fails when using flake syntax:
|
I don't think nixpkgs should point flakes users to Instead you may consider defining a flake that is nixpkgs which is configured to allow unfree packages. This isn't ideal, but well, there is a good reason why {
inputs.nixpkgs.url = "https://nixos.org/channels/nixos-20.09/nixexprs.tar.xz";
outputs = { self, nixpkgs }: {
defaultPackage.x86_64-linux = import nixpkgs {
system = "x86_64-linux";
config.allowUnfree = true;
};
};
} It's also possible to avoid flakes entirely which avoids the issue. |
This is indeed worth knowing, but I think it's too much information to put on a trace message like here. However, regarding:
It depends on what you define as "proper". The use case I had in mind, (which was not specific enough indeed) is testing updates via e.g |
f0a22dc
to
c9024ac
Compare
You can easily avoid flakes by using |
Hmm I see, but what about Just because something is experimental doesn't mean we can't at least explain better a tiny detail to users of this experimental feature. We've had contributions before to Besides, what is the worst thing that could happen? If at some point the flakes syntax would change, we'd only have to slightly update that message, and the price is 0 rebuilds, just as it is today. Please note @xfix that nothing in the new message's text recommends using flakes. |
Providing instructions for flakes makes the error message more noisy for users who don't use flakes. However, I think an improvement is still possible. It's possible to recognize whether an user is using flakes or not and provide a different message depending on that. That being said, I think there should be a way to pass configuration options into Nix flakes, it's just that it wasn't implemented yet. Worth noting that this isn't |
Indeed that would be ideal, though I'm not sure how would I do that - should it be a check of the current |
As discussed in: https://discourse.nixos.org/t/why-isnt-config-nixpkgs-config-nix-evaluated-for-nix-build/9579 It's a bit nontrivial that `nix build` needs the `--impure` flag in order to evaluate ~/.config/nixpkgs/config.nix.
c9024ac
to
e8b62f4
Compare
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/using-non-free-libraries-in-flakes/8632/15 |
@doronbehar sorry for bumping something from over a year ago but I managed to find my way here mostly because of your comments on discourse (in the above mentioned and others). Are there any updates on this? I know things might be a bit wild in your neck of the woods right about now. |
Not really, the last suggestion by @xfix was to make that eval message different for nixUnstable and nixStable users, but (now) I think it's not possible to do it -
Thanks a lot for your concern |
flakes is about improving purity so recommending |
Yea the problem is that it's impossible for that message to know whether it is being evaluated because someone imported Nixpkgs or because someone tried to evaluate a package from Nixpkgs' repo. In the first case I totally agree it'd be a bad advice. I'm not sure there's something we can do.. I'll close this. |
As discussed in:
https://discourse.nixos.org/t/why-isnt-config-nixpkgs-config-nix-evaluated-for-nix-build/9579
It's a bit nontrivial that
nix build
needs the--impure
flag inorder to evaluate ~/.config/nixpkgs/config.nix.
Motivation for this change
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)