Skip to content

fix: guard alsa-lib with lib.optionalString to prevent darwin eval failure - #1314

Merged
shunkakinoki merged 1 commit into
mainfrom
fix/alsa-lib-darwin-eval
Apr 1, 2026
Merged

fix: guard alsa-lib with lib.optionalString to prevent darwin eval failure#1314
shunkakinoki merged 1 commit into
mainfrom
fix/alsa-lib-darwin-eval

Conversation

@shunkakinoki

@shunkakinoki shunkakinoki commented Apr 1, 2026

Copy link
Copy Markdown
Owner

Summary

Test plan

  • nix build .#darwinConfigurations.runner.system --dry-run no longer throws alsa-lib error
  • e2e-run (MacOS) CI check passes
  • omp still works on NixOS

🤖 Generated with Claude Code


Summary by cubic

Guarded alsa-lib in shell configs using lib.optionalString pkgs.stdenv.isLinux to stop Darwin from evaluating a Linux-only derivation. Fixes MacOS eval errors and keeps Linux behavior unchanged.

  • Bug Fixes
    • Wrap alsa-lib in LD_LIBRARY_PATH for bash, zsh, and fish with lib.optionalString pkgs.stdenv.isLinux.
    • Prevent Nix from evaluating alsa-lib on aarch64-darwin (not in its meta.platforms).

Written for commit f95ac02. Summary will update on new commits.

…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>
Copilot AI review requested due to automatic review settings April 1, 2026 06:05
@mesa-dot-dev

mesa-dot-dev Bot commented Apr 1, 2026

Copy link
Copy Markdown

You do not have enough credits to review this pull request. Please purchase more credits to continue.

@coderabbitai

coderabbitai Bot commented Apr 1, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@shunkakinoki has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 1 minutes and 25 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: da773740-c70c-4231-b32c-42cebfc80cd4

📥 Commits

Reviewing files that changed from the base of the PR and between b424157 and f95ac02.

📒 Files selected for processing (3)
  • home-manager/programs/bash/default.nix
  • home-manager/programs/fish/default.nix
  • home-manager/programs/zsh/default.nix
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/alsa-lib-darwin-eval

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@shunkakinoki
shunkakinoki merged commit a26e833 into main Apr 1, 2026
27 of 29 checks passed
@shunkakinoki
shunkakinoki deleted the fix/alsa-lib-darwin-eval branch April 1, 2026 06:06
@mesa-dot-dev

mesa-dot-dev Bot commented Apr 1, 2026

Copy link
Copy Markdown

Mesa Description

TL;DR

Guarded alsa-lib references in shell configurations with lib.optionalString pkgs.stdenv.isLinux to prevent Nix from evaluating Linux-only derivations on macOS, resolving CI failures.

What changed?

Wrapped alsa-lib references in shell configurations with lib.optionalString pkgs.stdenv.isLinux.

Description generated by Mesa. Update settings

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-lib path injection into LD_LIBRARY_PATH behind lib.optionalString pkgs.stdenv.isLinux in zsh and bash configs.
  • Apply the same Linux-only guard for alsa-lib in fish’s LD_LIBRARY_PATH setup.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants