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
nixos: add preferLocalBuild=true; on derivations for config files and closureInfo #50504
Conversation
Looks okay to me. Not to bikeshed here but I wonder if runCommand should just always do preferLocalBuild? Those are rarely big enough for it to be worthwhile to do remotely. |
Perhaps |
What is the purpose of |
@symphorien If it is false then the derivation will always be built, no substitution will be attempted. I.e., no network traffic. At least that is my interpretation of the description in the manual. |
So I tried to add
instead of
I have no idea what causes this error. Here is the branch if you want to debug it: 428164a |
So the reason seems that the installer uses the installation medium's store as a substituter: |
Is there something I should add to get the PR merged ? |
It looks good to me 👍 |
@@ -8,6 +8,7 @@ let | |||
if (cfg.configFile == null) then | |||
(pkgs.runCommand "config.toml" { | |||
buildInputs = [ pkgs.remarshal ]; | |||
preferLocalBuild = true; |
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.
A toTOML
would fit well into nixos/lib
btw.
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.
However does not need to be solved within the scope of this pr.
44933f0
to
0a379a5
Compare
I fixed the merge conflict. |
Oh, there is another merge conflict. I expect more to come, so if someone wants to merge this PR, tell me and I will resolve the conflict :) |
@symphorien Please do. I've asked in #nixos-dev whether there are any reservations about merging this and I'll try to follow up on it so that we can get this in. |
0a379a5
to
a915b33
Compare
I rebased, and ran the installer.simple test succesfully. |
Nice! |
Thanks! 👍 |
Motivation for this change
When using remote builders, nix would copy the closure of the config files to the remote builder when only the path is really needed, which can take a sizeable amount of time depending on the network speed. This is notably annoying for closure-info.
Things done
sandbox
innix.conf
on non-NixOS)which is independent of this change (it was failing before)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)Tested on top of current nixos-unstable, not tested after rebase on master.