fix: guard alsa-lib with lib.optionalString to prevent darwin eval failure - #1314
Conversation
…win eval failure alsa-lib's meta.platforms excludes darwin, causing nix to throw even when the reference is inside a Linux-only block because string interpolation forces derivation evaluation. Use lib.optionalString stdenv.isLinux to prevent alsa-lib from being evaluated on darwin. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
You do not have enough credits to review this pull request. Please purchase more credits to continue. |
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 1 minutes and 25 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Mesa DescriptionTL;DRGuarded What changed?Wrapped Description generated by Mesa. Update settings |
There was a problem hiding this comment.
Code Review
This pull request modifies the Bash, Fish, and Zsh shell configurations to conditionally include the alsa-lib library in the LD_LIBRARY_PATH environment variable only on Linux systems. This change improves cross-platform compatibility by ensuring that Linux-specific dependencies are not referenced on other operating systems. I have no feedback to provide as there were no review comments to evaluate.
There was a problem hiding this comment.
Pull request overview
Guards alsa-lib usage in shell environment configuration to prevent Nix evaluation failures on macOS (Darwin) where alsa-lib is Linux-only, addressing the e2e-run (MacOS) CI failure noted in #1309.
Changes:
- Wrap
alsa-libpath injection intoLD_LIBRARY_PATHbehindlib.optionalString pkgs.stdenv.isLinuxin zsh and bash configs. - Apply the same Linux-only guard for
alsa-libin fish’sLD_LIBRARY_PATHsetup.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| home-manager/programs/zsh/default.nix | Makes alsa-lib contribution to LD_LIBRARY_PATH conditional on Linux to avoid Darwin eval failures. |
| home-manager/programs/fish/default.nix | Avoids referencing alsa-lib on non-Linux by conditionally emitting the fish argument. |
| home-manager/programs/bash/default.nix | Conditionally includes alsa-lib in LD_LIBRARY_PATH in both relevant bash init blocks to prevent Darwin eval failures. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
alsa-libreferences in shell configs withlib.optionalString pkgs.stdenv.isLinuxto prevent Nix from evaluating the derivation on darwine2e-run (MacOS)CI failure from fix: add LD_LIBRARY_PATH for bun-installed native addons on NixOS #1309 wherealsa-lib(Linux-only inmeta.platforms) caused eval to throw onaarch64-darwinTest plan
nix build .#darwinConfigurations.runner.system --dry-runno longer throws alsa-lib errore2e-run (MacOS)CI check passesompstill works on NixOS🤖 Generated with Claude Code
Summary by cubic
Guarded
alsa-libin shell configs usinglib.optionalString pkgs.stdenv.isLinuxto stop Darwin from evaluating a Linux-only derivation. Fixes MacOS eval errors and keeps Linux behavior unchanged.alsa-libinLD_LIBRARY_PATHfor bash, zsh, and fish withlib.optionalString pkgs.stdenv.isLinux.alsa-libonaarch64-darwin(not in itsmeta.platforms).Written for commit f95ac02. Summary will update on new commits.