@@ -209,7 +209,7 @@ pub async fn build_profile_remotely(data: &PushProfileData<'_>, derivation_name:
209
209
Ok ( ( ) )
210
210
}
211
211
212
- pub async fn push_profile ( data : PushProfileData < ' _ > ) -> Result < ( ) , PushProfileError > {
212
+ pub async fn build_profile ( data : PushProfileData < ' _ > ) -> Result < ( ) , PushProfileError > {
213
213
debug ! (
214
214
"Finding the deriver of store path for {}" ,
215
215
& data. deploy_data. profile. profile_settings. path
@@ -218,17 +218,6 @@ pub async fn push_profile(data: PushProfileData<'_>) -> Result<(), PushProfileEr
218
218
// `nix-store --query --deriver` doesn't work on invalid paths, so we parse output of show-derivation :(
219
219
let mut show_derivation_command = Command :: new ( "nix" ) ;
220
220
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
-
232
221
show_derivation_command
233
222
. arg ( "show-derivation" )
234
223
. arg ( & data. deploy_data . profile . profile_settings . path ) ;
@@ -259,12 +248,28 @@ pub async fn push_profile(data: PushProfileData<'_>) -> Result<(), PushProfileEr
259
248
return Err ( PushProfileError :: RemoteBuildWithLegacyNix )
260
249
}
261
250
262
- // remote building guarantees that the resulting derivation is stored on the target system
263
- // no need to copy after building
264
251
build_profile_remotely ( & data, derivation_name) . await ?;
265
252
} else {
266
253
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 ( " " ) ;
267
269
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 ) {
268
273
info ! (
269
274
"Copying profile `{}` to node `{}`" ,
270
275
data. deploy_data. profile_name, data. deploy_data. node_name
0 commit comments