Distributed build: Difference between revisions

m Setting up SSH: Minor wikicode formatting
m Changed `nix store ping` to `nix store info`, because of the warning: 'ping' is a deprecated alias for 'info'.
 
(2 intermediate revisions by 2 users not shown)
Line 40: Line 40:
{{Tip|The best test to check that the SSH access works for Nix is to run on your local machine:
{{Tip|The best test to check that the SSH access works for Nix is to run on your local machine:


<code>nix store ping --store ssh://<REMOTE-BUILDER></code>
<code>nix store info --store ssh://<REMOTE-BUILDER></code>


Where <code><REMOTE-BUILDER></code> is the remote builder's IP address, host address or whatever name you configure in ~/.ssh/config or /root/.ssh/config, including the user@ prefix.}}
Where <code><REMOTE-BUILDER></code> is the remote builder's IP address, host address or whatever name you configure in ~/.ssh/config or /root/.ssh/config, including the user@ prefix.}}
Line 112: Line 112:
You may also want to make nix on '''the remote machine''' trust that new user by adding it to {{ic|nix.settings.trusted-users}} if it's using NixOS, or by manually adding <code><nowiki>trusted-users = nixremote</nowiki></code> to {{ic|/etc/nix/nix.conf}}.
You may also want to make nix on '''the remote machine''' trust that new user by adding it to {{ic|nix.settings.trusted-users}} if it's using NixOS, or by manually adding <code><nowiki>trusted-users = nixremote</nowiki></code> to {{ic|/etc/nix/nix.conf}}.


== '''Modify the local machine's Nix config to know about the remote machine'''. ==
== Modify the local machine's Nix config to know about the remote machine. ==
The Nix package manager '''on your local machine''' '''needs to know that the remote builder exists''' and what its ''supported features'' are. See [https://nixos.org/manual/nix/stable/command-ref/conf-file#conf-system-features official supportedFeatures documentation].  
The Nix package manager '''on your local machine''' '''needs to know that the remote builder exists''' and what its ''supported features'' are. See [https://nixos.org/manual/nix/stable/command-ref/conf-file#conf-system-features official supportedFeatures documentation].  


Line 249: Line 249:
* I can ping the store as root, but I'm getting "broken pipe" errors when trying to distribute.
* I can ping the store as root, but I'm getting "broken pipe" errors when trying to distribute.
** You may have hit bug {{Issue|46038}}. Add <code>nix.distributedBuilds = true;</code> to <code>configuration.nix</code> and <code>nixos-rebuild switch</code>.
** You may have hit bug {{Issue|46038}}. Add <code>nix.distributedBuilds = true;</code> to <code>configuration.nix</code> and <code>nixos-rebuild switch</code>.
== Tips and tricks ==
=== One-time remote build ===
For a quick, one-time remote build without needing to change any system settings, see [[Nixos-rebuild#Deploying_on_other_machines]].


== See also ==
== See also ==