@@ -209,7 +209,7 @@ pub async fn build_profile_remotely(data: &PushProfileData<'_>, derivation_name:
209209 Ok ( ( ) )
210210}
211211
212- pub async fn push_profile ( data : PushProfileData < ' _ > ) -> Result < ( ) , PushProfileError > {
212+ pub async fn build_profile ( data : PushProfileData < ' _ > ) -> Result < ( ) , PushProfileError > {
213213 debug ! (
214214 "Finding the deriver of store path for {}" ,
215215 & data. deploy_data. profile. profile_settings. path
@@ -218,17 +218,6 @@ pub async fn push_profile(data: PushProfileData<'_>) -> Result<(), PushProfileEr
218218 // `nix-store --query --deriver` doesn't work on invalid paths, so we parse output of show-derivation :(
219219 let mut show_derivation_command = Command :: new ( "nix" ) ;
220220
221- let ssh_opts_str = data
222- . deploy_data
223- . merged_settings
224- . ssh_opts
225- // This should provide some extra safety, but it also breaks for some reason, oh well
226- // .iter()
227- // .map(|x| format!("'{}'", x))
228- // .collect::<Vec<String>>()
229- . join ( " " ) ;
230-
231-
232221 show_derivation_command
233222 . arg ( "show-derivation" )
234223 . arg ( & data. deploy_data . profile . profile_settings . path ) ;
@@ -259,12 +248,28 @@ pub async fn push_profile(data: PushProfileData<'_>) -> Result<(), PushProfileEr
259248 return Err ( PushProfileError :: RemoteBuildWithLegacyNix )
260249 }
261250
262- // remote building guarantees that the resulting derivation is stored on the target system
263- // no need to copy after building
264251 build_profile_remotely ( & data, derivation_name) . await ?;
265252 } else {
266253 build_profile_locally ( & data, derivation_name) . await ?;
254+ }
255+
256+ Ok ( ( ) )
257+ }
258+
259+ pub async fn push_profile ( data : PushProfileData < ' _ > ) -> Result < ( ) , PushProfileError > {
260+ let ssh_opts_str = data
261+ . deploy_data
262+ . merged_settings
263+ . ssh_opts
264+ // This should provide some extra safety, but it also breaks for some reason, oh well
265+ // .iter()
266+ // .map(|x| format!("'{}'", x))
267+ // .collect::<Vec<String>>()
268+ . join ( " " ) ;
267269
270+ // remote building guarantees that the resulting derivation is stored on the target system
271+ // no need to copy after building
272+ if !data. deploy_data . merged_settings . remote_build . unwrap_or ( false ) {
268273 info ! (
269274 "Copying profile `{}` to node `{}`" ,
270275 data. deploy_data. profile_name, data. deploy_data. node_name
0 commit comments