Currently, when building a package remotely with build-remote.pl, if the remote host is missing some dependencies, these will be sent over the network from the local host. However, when the connection between the local and the remote hosts is slow, it would be preferable to download as many of those dependencies as possible from nixos.org using the substitutes approach.
To achieve this, I think it should suffice to change build-remote.pl so that it passes, optionally, the --use-substitutes flag to nix-copy-closure (well, Nix::CopyClosure::copyToOpen actually). Please correct me if I am wrong, as I am not familiar with the code base here.
I wonder what is the best way to enable/disable this feature so that the caller of nix-build can decide whether to use substitutes in the remote end or not.
I am happy to try and implement this.
Currently, when building a package remotely with
build-remote.pl, if the remote host is missing some dependencies, these will be sent over the network from the local host. However, when the connection between the local and the remote hosts is slow, it would be preferable to download as many of those dependencies as possible fromnixos.orgusing the substitutes approach.To achieve this, I think it should suffice to change
build-remote.plso that it passes, optionally, the--use-substitutesflag tonix-copy-closure(well,Nix::CopyClosure::copyToOpenactually). Please correct me if I am wrong, as I am not familiar with the code base here.I wonder what is the best way to enable/disable this feature so that the caller of
nix-buildcan decide whether to use substitutes in the remote end or not.I am happy to try and implement this.