diff options
author | Roman Melnikov | 2024-06-12 14:07:33 +0200 |
---|---|---|
committer | GitHub | 2024-06-12 14:07:33 +0200 |
commit | 3867348fa92bc892eba5d9ddb2d7a97b9e127a8a (patch) | |
tree | 1c2cf8365dcabb72eb306e0e8577f2772197157b /src/push.rs | |
parent | 254e9d150aa273591aee1433112a8781fd4ffd71 (diff) | |
parent | d3b11225fcb129ccb5e07b716b7484a93e68771d (diff) |
Merge pull request #272 from stuebinm/fix-nonflake-build
fix nix-build invocation in non-flake builds
Diffstat (limited to 'src/push.rs')
-rw-r--r-- | src/push.rs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/push.rs b/src/push.rs index c800a98..864c336 100644 --- a/src/push.rs +++ b/src/push.rs @@ -244,9 +244,13 @@ pub async fn build_profile(data: PushProfileData<'_>) -> Result<(), PushProfileE .next() .ok_or(PushProfileError::ShowDerivationEmpty)?; - // Since nix 2.15.0 'nix build <path>.drv' will build only the .drv file itself, not the - // derivation outputs, '^out' is used to refer to outputs explicitly - let new_deriver = &(deriver.to_owned().to_string() + "^out"); + let new_deriver = &if data.supports_flakes { + // Since nix 2.15.0 'nix build <path>.drv' will build only the .drv file itself, not the + // derivation outputs, '^out' is used to refer to outputs explicitly + deriver.to_owned().to_string() + "^out" + } else { + deriver.to_owned() + }; let path_info_output = Command::new("nix") .arg("--experimental-features").arg("nix-command") |