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 |
| 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.
"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."
| 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.
| 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: |
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 eval-system option (cherry picked from commit 071dbbe) Change-Id: Ia81358c8cfb60241da07a4d0e84b9ee62a18a53f
Add a new
eval-systemoption.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,
systemalso effects scheduling which will cause Nix to build those derivations locally even if that doesn't make sense.eval-systemonly takes effect if it is non-empty. If empty (the default)systemis used as before, so there is no breakage.