Skip to content

fix: remove legacy darwin.apple_sdk reference in flake.nix#164

Open
nklmilojevic wants to merge 2 commits intogoogleworkspace:mainfrom
nklmilojevic:fix/nix-flake-darwin-apple-sdk
Open

fix: remove legacy darwin.apple_sdk reference in flake.nix#164
nklmilojevic wants to merge 2 commits intogoogleworkspace:mainfrom
nklmilojevic:fix/nix-flake-darwin-apple-sdk

Conversation

@nklmilojevic
Copy link

Description

darwin.apple_sdk has been removed from nixpkgs-unstable as a legacy compatibility stub. The Security framework is now provided by the default Apple SDK included in stdenv, so the explicit dependency is no longer needed.

Also updates stdenv.isLinux/stdenv.isDarwin to the non-deprecated stdenv.hostPlatform.isLinux/stdenv.hostPlatform.isDarwin.

Checklist:

  • My code follows the AGENTS.md guidelines (no generated google-* crates).
  • I have run cargo fmt --all to format the code perfectly.
  • I have run cargo clippy -- -D warnings and resolved all warnings.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have provided a Changeset file (e.g. via pnpx changeset) to document my changes.

^
N/A — this change only modifies flake.nix, no Rust/TS code was changed.

`darwin.apple_sdk` has been removed from nixpkgs-unstable as a legacy
compatibility stub. The Security framework is now provided by the
default Apple SDK included in stdenv, so the explicit dependency is
no longer needed.

Also updates `stdenv.isLinux`/`stdenv.isDarwin` to the non-deprecated
`stdenv.hostPlatform.isLinux`/`stdenv.hostPlatform.isDarwin`.
@changeset-bot
Copy link

changeset-bot bot commented Mar 5, 2026

🦋 Changeset detected

Latest commit: 97c9132

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request updates the flake.nix configuration to align with recent changes in nixpkgs-unstable. It addresses the deprecation and removal of a specific Darwin SDK reference by removing it from the build inputs, as the functionality is now implicitly handled. Additionally, it modernizes the platform detection logic by switching to the recommended stdenv.hostPlatform attributes.

Highlights

  • Dependency Removal: Removed the darwin.apple_sdk.frameworks.Security dependency from flake.nix as it has been deprecated and removed from nixpkgs-unstable, with the Security framework now provided by the default Apple SDK.
  • Platform Check Update: Updated stdenv.isLinux and stdenv.isDarwin to their non-deprecated counterparts, stdenv.hostPlatform.isLinux and stdenv.hostPlatform.isDarwin, respectively.
Changelog
  • flake.nix
    • Removed darwin.apple_sdk.frameworks.Security from darwinDeps.
    • Updated stdenv.isLinux to stdenv.hostPlatform.isLinux.
    • Updated stdenv.isDarwin to stdenv.hostPlatform.isDarwin.
Activity
  • No human activity has occurred on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

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

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 correctly updates the flake.nix file by removing a legacy darwin.apple_sdk dependency and replacing deprecated platform checks (stdenv.isLinux/stdenv.isDarwin) with their stdenv.hostPlatform.* counterparts. The changes align with recent updates in nixpkgs-unstable. I've added one minor suggestion to improve code style by avoiding the with statement, following Nix community best practices.

Comment on lines 25 to 27
darwinDeps = with pkgs; [
libiconv
darwin.apple_sdk.frameworks.Security
];
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

While this works, it's a good practice in Nix to avoid using with as it can sometimes make it harder to track where attributes are coming from. Since darwinDeps now only contains one package, you can define it more directly.

        darwinDeps = [ pkgs.libiconv ];
References
  1. In Nix, it is generally discouraged to use the with keyword as it can obscure the origin of variables, making the code harder to read and maintain. It's better to explicitly qualify attributes (e.g., pkgs.libiconv).

@jpoehnelt jpoehnelt requested a review from sqrrrl March 5, 2026 16:21
@codecov
Copy link

codecov bot commented Mar 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 55.19%. Comparing base (f6d74b0) to head (764b501).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #164   +/-   ##
=======================================
  Coverage   55.19%   55.19%           
=======================================
  Files          38       38           
  Lines       13166    13166           
=======================================
  Hits         7267     7267           
  Misses       5899     5899           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@malob
Copy link

malob commented Mar 5, 2026

Appreciate this, I ran into the same issue.

One additional suggestion: consider switching the flake's nixpkgs input from nixos-unstable to nixpkgs-unstable. nixos-unstable is gated on NixOS (Linux) CI, while nixpkgs-unstable includes Darwin CI checks — more appropriate for a tool that explicitly targets macOS. This would also reduce the chance of similar Darwin breakage slipping through in future lock updates.

@jpoehnelt jpoehnelt added area: distribution cla: yes This human has signed the Contributor License Agreement. complexity: low Small, straightforward change labels Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: distribution cla: yes This human has signed the Contributor License Agreement. complexity: low Small, straightforward change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants