fix(nix): make flake.nix work on macOS#29
Open
XerWandeRer wants to merge 1 commit intoWenSimEHRP:mainfrom
Open
fix(nix): make flake.nix work on macOS#29XerWandeRer wants to merge 1 commit intoWenSimEHRP:mainfrom
XerWandeRer wants to merge 1 commit intoWenSimEHRP:mainfrom
Conversation
Guard Linux-only dependencies (Vulkan, X11, Wayland, mold, libudev, LD_LIBRARY_PATH) behind `isLinux` checks so `nix develop` works on macOS without `allowUnsupportedSystem`. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Owner
|
Does it work on your machine? |
Author
|
Yes! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
nix develop在 macOS 上会失败,因为runtimeLibs无条件引入了 Linux-only 的依赖(vulkan-loader、wayland、libudev-zero 等),导致 nix 拒绝 evaluate。本 PR 用
isLinux条件守卫将 Linux-only 的部分隔离:runtimeLibs整体用pkgs.lib.optionals isLinux包裹mold、clang、stdenv.cc.cc仅在 Linux 下加入buildInputsLD_LIBRARY_PATH仅在 Linux 下设置x86_64-unknown-linux-gnurust target 仅在 Linux 下添加macOS 用户现在可以直接
nix develop进入开发环境。Linux 行为不变。