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
Add eval-system option #4093
Add eval-system option #4093
Conversation
bc096f7
to
61b5809
Compare
I marked this as stale due to inactivity. → More info |
I closed this issue due to inactivity. → More info |
Still relevant. Setting @matthewbauer not sure if you have time to rebase, so feel free to wait until the Nix team approves the goal/implementation strategy first. It does seem like a simple PR fwiw. |
Oh this is good I think. We can put this in This removes the incentive to start talking about |
src/libstore/globals.hh
Outdated
report when evaluating Nix expressions. This can be accessed | ||
via builtins.currentSystem. Unlike `system`, this setting | ||
does not change what kind of derivations can be built | ||
locally. This is useful for evaluating Nix on your system |
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.
"evaluating Nix": should be evaluating Nix code or something like that.
Actually the whole sentence should be rephrased to something like "This is useful for producing derivations to be built on another type of system."
src/libstore/globals.hh
Outdated
R"( | ||
This option specifies the canonical Nix system name to | ||
report when evaluating Nix expressions. This can be accessed | ||
via builtins.currentSystem. Unlike `system`, this setting |
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.
via builtins.currentSystem. Unlike `system`, this setting | |
via [`builtins.currentSystem`](@docroot@/language/builtins-constants.md#builtin-constants-currentSystem). Unlike [`system`](#conf-system), this setting |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2023-07-10-nix-team-meeting-minutes-70/30471/1 |
085746a
to
f40267c
Compare
`eval-system` option overrides just the value of `builtins.currentSystem`. This is more useful than overriding `system` since you can build these derivations on remote builders which can work on the given system. Co-authored-by: John Ericson <John.Ericson@Obsidian.Systems> Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
f40267c
to
bcbdb09
Compare
These were under-tested. This tests the status quo and especially previous commit of this PR better.
d1b088e
to
228e995
Compare
I forgot tests and release note. Now they added, and this is ready to merge. |
Add a new
eval-system
option.Unlike
system
, it just overrides the value ofbuiltins.currentSystem
.This is more useful than overriding
system
, because you can build these derivations on remote builders which can work on the given system.In contrast,
system
also effects scheduling which will cause Nix to build those derivations locally even if that doesn't make sense.eval-system
only takes effect if it is non-empty. If empty (the default)system
is used as before, so there is no breakage.