From ae544cdaae94f12b2804e1a5b2007a1073f108b5 Mon Sep 17 00:00:00 2001 From: DottoDev <37108907+DottoDev@users.noreply.github.com> Date: Mon, 10 Oct 2022 20:22:06 +0000 Subject: [PATCH] fix: skip nix on darwin only when nix-darwin is installed (#14) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Authored-by: XYenon Approved-by: Thomas Schönauer --- src/steps/os/unix.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/steps/os/unix.rs b/src/steps/os/unix.rs index 540d2ad3..5ee4687c 100644 --- a/src/steps/os/unix.rs +++ b/src/steps/os/unix.rs @@ -296,6 +296,16 @@ pub fn run_nix(ctx: &ExecutionContext) -> Result<()> { } } + #[cfg(target_os = "macos")] + { + if let Ok(..) = require("darwin-rebuild") { + return Err(SkipStep(String::from( + "Nix-darwin on macOS must be upgraded via darwin-rebuild switch", + )) + .into()); + } + } + let run_type = ctx.run_type(); if should_self_upgrade {